<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"blog.hory-ai.com","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"right","Muse | Mist":320,"display":"always","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":true},"bookmark":{"enable":true,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta property="og:type" content="website">
<meta property="og:title" content="Horysk 宏睿时空">
<meta property="og:url" content="http://blog.hory-ai.com/page/3/index.html">
<meta property="og:site_name" content="Horysk 宏睿时空">
<meta property="og:locale" content="en_US">
<meta property="article:author" content="Hory Skone">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://blog.hory-ai.com/page/3/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : true,
    isPost : false,
    lang   : 'en'
  };
</script>

  <title>Horysk 宏睿时空</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Horysk 宏睿时空</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>Tags</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>Categories</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>Search
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="Searching..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <a href="https://github.com/horysk" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content index posts-expand">
            



	<div class="tag-cloud">
	  <div class="tag-cloud-tags" id="tags">
		<a href="/tags/AI/" style="font-size: 16px; color: #fff">AI</a> <a href="/tags/BI/" style="font-size: 16px; color: #fff">BI</a> <a href="/tags/Centos/" style="font-size: 16px; color: #fff">Centos</a> <a href="/tags/DNS/" style="font-size: 16px; color: #fff">DNS</a> <a href="/tags/Dapp/" style="font-size: 16px; color: #fff">Dapp</a> <a href="/tags/Docker/" style="font-size: 16px; color: #fff">Docker</a> <a href="/tags/Hack/" style="font-size: 16px; color: #fff">Hack</a> <a href="/tags/Hexo/" style="font-size: 16px; color: #fff">Hexo</a> <a href="/tags/HyperLedger-Fabric/" style="font-size: 16px; color: #fff">HyperLedger Fabric</a> <a href="/tags/Hyperledger-Fabric/" style="font-size: 16px; color: #fff">Hyperledger Fabric</a> <a href="/tags/Iftop/" style="font-size: 16px; color: #fff">Iftop</a> <a href="/tags/Linux/" style="font-size: 16px; color: #fff">Linux</a> <a href="/tags/ML/" style="font-size: 16px; color: #fff">ML</a> <a href="/tags/MTProxy/" style="font-size: 16px; color: #fff">MTProxy</a> <a href="/tags/Mongo/" style="font-size: 16px; color: #fff">Mongo</a> <a href="/tags/Network/" style="font-size: 16px; color: #fff">Network</a> <a href="/tags/Pyppeteer/" style="font-size: 16px; color: #fff">Pyppeteer</a> <a href="/tags/Tools/" style="font-size: 16px; color: #fff">Tools</a> <a href="/tags/VPN/" style="font-size: 16px; color: #fff">VPN</a> <a href="/tags/Vnc/" style="font-size: 16px; color: #fff">Vnc</a> <a href="/tags/baostock/" style="font-size: 16px; color: #fff">baostock</a> <a href="/tags/block-chain/" style="font-size: 16px; color: #fff">block chain</a> <a href="/tags/centos-xfce-vnc/" style="font-size: 16px; color: #fff">centos-xfce-vnc</a> <a href="/tags/docker/" style="font-size: 16px; color: #fff">docker</a> <a href="/tags/fabric/" style="font-size: 16px; color: #fff">fabric</a> <a href="/tags/hexo/" style="font-size: 16px; color: #fff">hexo</a> <a href="/tags/horysk/" style="font-size: 16px; color: #fff">horysk</a> <a href="/tags/k8s/" style="font-size: 16px; color: #fff">k8s</a> <a href="/tags/linux/" style="font-size: 16px; color: #fff">linux</a> <a href="/tags/mongo/" style="font-size: 16px; color: #fff">mongo</a> <a href="/tags/pyppeteer/" style="font-size: 16px; color: #fff">pyppeteer</a> <a href="/tags/python/" style="font-size: 16px; color: #fff">python</a> <a href="/tags/quant/" style="font-size: 16px; color: #fff">quant</a> <a href="/tags/stock/" style="font-size: 16px; color: #fff">stock</a> <a href="/tags/tushare/" style="font-size: 16px; color: #fff">tushare</a>
	  </div>
	</div>

	
	<script type="text/javascript">
     var alltags = document.getElementsByClassName('tag-cloud-tags');
     var tags = alltags[0].getElementsByTagName('a');
     for (var i = tags.length - 1; i >= 0; i--) {
       var r=Math.floor(Math.random()*75+130);
       var g=Math.floor(Math.random()*75+100);
       var b=Math.floor(Math.random()*75+80);
       tags[i].style.background = "rgb("+r+","+g+","+b+")";
     }
</script>

<style>
  .tag-cloud-tags{
    /*font-family: Helvetica, Tahoma, Arial;*/
    /*font-weight: 100;*/
    text-align: center;
    counter-reset: tags;
  }
  .tag-cloud-tags a{
    border-radius: 6px;
    padding-right: 5px;
    padding-left: 5px;
    margin: 8px 5px 0px 0px;
  }
  .tag-cloud-tags a:before{
    content: "?";
  }

  .tag-cloud-tags a:hover{
     box-shadow: 0px 5px 15px 0px rgba(0,0,0,.4);
     transform: scale(1.1);
     /*box-shadow: 10px 10px 15px 2px rgba(0,0,0,.12), 0 0 6px 0 rgba(104, 104, 105, 0.1);*/
     transition-duration: 0.15s;
  }
</style>

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/27/Pyppeteer%E5%BA%93%E4%B9%8B%E4%BA%8C%EF%BC%9APyppeteer%E7%9A%84%E6%B5%8F%E8%A7%88%E5%99%A8%E5%AF%B9%E8%B1%A1/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/27/Pyppeteer%E5%BA%93%E4%B9%8B%E4%BA%8C%EF%BC%9APyppeteer%E7%9A%84%E6%B5%8F%E8%A7%88%E5%99%A8%E5%AF%B9%E8%B1%A1/" class="post-title-link" itemprop="url">Pyppeteer库之二：Pyppeteer的浏览器对象</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-27 17:56:08" itemprop="dateCreated datePublished" datetime="2020-07-27T17:56:08+00:00">2020-07-27</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Pyppeteer/" itemprop="url" rel="index"><span itemprop="name">Pyppeteer</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/27/Pyppeteer%E5%BA%93%E4%B9%8B%E4%BA%8C%EF%BC%9APyppeteer%E7%9A%84%E6%B5%8F%E8%A7%88%E5%99%A8%E5%AF%B9%E8%B1%A1/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/27/Pyppeteer%E5%BA%93%E4%B9%8B%E4%BA%8C%EF%BC%9APyppeteer%E7%9A%84%E6%B5%8F%E8%A7%88%E5%99%A8%E5%AF%B9%E8%B1%A1/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>4k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>4 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>启动器Launcher<br>启动方式：</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"> launch :启动链接一个新的浏览器</span><br><span class="line"> content :链接已打开的浏览器，便于崩溃后重链</span><br><span class="line"></span><br><span class="line">launch()</span><br><span class="line">pyppeteer.launch(options: dict = None, **kwargs: Any) -&gt; Browser</span><br></pre></td></tr></table></figure>
<p>启动一个新的浏览器，返回 Browser 类。接受字典或键值对的关键字配置参数。</p>
<p>常用参数：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">headless(<span class="built_in">bool</span>): 是否启用<span class="string">&quot;无头模式&quot;</span>(隐藏浏览器界面)，默认为 <span class="literal">True</span> 。</span><br><span class="line">executablePath(<span class="built_in">str</span>): 指定 Chromium.exe 文件的路径(不使用内置的chromium)。</span><br><span class="line">slowMo（<span class="built_in">int</span>|<span class="built_in">float</span>）:按指定的毫秒数减慢 pyppeteer 的速度。</span><br><span class="line">args(List[<span class="built_in">str</span>]): 启动 Chromium 的参数。</span><br><span class="line">dumpio(<span class="built_in">bool</span>):是否将浏览器进程标准输出和标准错误输入到 process.stdout 和 process.stderr中。默认是 <span class="literal">False</span>。</span><br><span class="line">userDataDir(<span class="built_in">str</span>): 设置用户数据目录。</span><br><span class="line">devtools(<span class="built_in">bool</span>): 是否为每个选项卡自动打开 DevTools 面板， 这个选项只有当 headless 设置为 <span class="literal">False</span>的时候有效。</span><br></pre></td></tr></table></figure>
<p>args—&gt;启动chrome的参数：<br><a target="_blank" rel="noopener" href="https://peter.sh/experiments/chromium-command-line-switches/">pyppeteer官网</a></p>
<p>launch常用参数配置:</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">kwargs = &#123;</span><br><span class="line">    <span class="comment"># 启用浏览器界面</span></span><br><span class="line">    <span class="string">&#x27;headless&#x27;</span>: <span class="literal">False</span>,</span><br><span class="line">    <span class="comment"># 多开页面，解决卡死</span></span><br><span class="line">    <span class="string">&#x27;dumpio&#x27;</span>: <span class="literal">True</span>,</span><br><span class="line">    <span class="comment"># 设置浏览器全屏</span></span><br><span class="line">    <span class="string">&#x27;args&#x27;</span>: [<span class="string">&#x27;--start-maximized&#x27;</span>,</span><br><span class="line">             <span class="comment"># 取消沙盒模式，沙盒模式下权限太小</span></span><br><span class="line">             <span class="string">&#x27;--no-sandbox&#x27;</span>,</span><br><span class="line">             <span class="comment"># 设置浏览器界面大小</span></span><br><span class="line">             <span class="string">&#x27;--window-size=1366,768&#x27;</span>,</span><br><span class="line">             <span class="comment"># 关闭受控制提示：比如，Chrome正在受到自动测试软件的控制...</span></span><br><span class="line">             <span class="string">&#x27;--disable-infobars&#x27;</span>,</span><br><span class="line">             <span class="comment"># 允许跨域</span></span><br><span class="line">             <span class="string">&#x27;--disable-web-security&#x27;</span>,</span><br><span class="line">             <span class="comment"># 使用代理</span></span><br><span class="line">             <span class="string">&#x27;--proxy-server=127.0.0.1:80&#x27;</span>,</span><br><span class="line">             <span class="comment"># 不走代理的链接</span></span><br><span class="line">             <span class="string">&#x27;--proxy-bypass-list=*&#x27;</span>,</span><br><span class="line">             <span class="comment"># 忽略证书错误</span></span><br><span class="line">             <span class="string">&#x27;--ignore-certificate-errors&#x27;</span>,</span><br><span class="line">             <span class="comment"># log 等级设置，如果出现一大堆warning，可以不使用默认的日志等级</span></span><br><span class="line">             <span class="string">&#x27;--log-level=3&#x27;</span>,</span><br><span class="line">             <span class="comment"># 设置ua</span></span><br><span class="line">             <span class="string">&#x27;--user-agent=Mozilla/5.0&#x27;</span></span><br><span class="line">             ],</span><br><span class="line">    <span class="string">&#x27;userDataDir&#x27;</span>: <span class="string">r&#x27;D:\Temporary&#x27;</span>,</span><br><span class="line">    <span class="comment"># 用户数据保存目录，这个最好指定一个，</span></span><br><span class="line">    <span class="comment"># 如果不指定，Chrome会自动创建一个临时目录使用，在退出浏览器时自动删除，</span></span><br><span class="line">    <span class="comment"># 在删除的时候可能会删除失败(不知道为什么出现权限问题，我用Windows)导致浏览器退出失败</span></span><br><span class="line">    <span class="comment"># 删除失败时出现报错：OSError: Unable to remove Temporary User Data</span></span><br><span class="line">    <span class="comment"># 或者Chrome进程没有退出，cpu狂飙到99%</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">content()</span><br><span class="line">pyppeteer.connect(options: dict = None, **kwargs: Any) -&gt; Browser</span><br></pre></td></tr></table></figure>
<p>链接已打开的浏览器，返回 Browser 类。接受字典或键值对的关键字配置参数。</p>
<p>参数：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">browserWSEndpoint（<span class="built_in">str</span>）：要连接的浏览器 websocket 端点。（必填）</span><br><span class="line">ignoreHTTPSErrors（<span class="built_in">bool</span>）：是否忽略 HTTPS 错误。默认为 <span class="literal">False</span>。</span><br><span class="line">slowMo（<span class="built_in">int</span> | <span class="built_in">float</span>）：按指定的毫秒数减慢pyppeteer的速度。</span><br><span class="line">logLevel（<span class="built_in">int</span> | <span class="built_in">str</span>）：用于打印日志的日志级别。默认值与根记录器相同。</span><br><span class="line">loop（asyncio.AbstractEventLoop）：事件循环（实验）。</span><br><span class="line"></span><br><span class="line">browserWSEndpoint 的值获取：Browser.wsEndpoint</span><br></pre></td></tr></table></figure>

<p>例子：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> asyncio</span><br><span class="line"><span class="keyword">import</span> pyppeteer</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">async</span> <span class="function"><span class="keyword">def</span> <span class="title">main</span>():</span></span><br><span class="line">    browser = <span class="keyword">await</span> pyppeteer.launch(&#123;<span class="string">&#x27;headless&#x27;</span>: <span class="literal">False</span>&#125;)</span><br><span class="line">    page = <span class="keyword">await</span> browser.newPage()</span><br><span class="line">    <span class="keyword">await</span> page.setViewport(&#123;<span class="string">&#x27;width&#x27;</span>: <span class="number">1366</span>, <span class="string">&#x27;height&#x27;</span>: <span class="number">768</span>&#125;)</span><br><span class="line">    <span class="keyword">await</span> page.goto(<span class="string">&#x27;https://www.baidu.com&#x27;</span>)</span><br><span class="line">    ws = browser.wsEndpoint</span><br><span class="line">    print(ws)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">await</span> browser.disconnect()  <span class="comment"># 断开链接</span></span><br><span class="line">    browser2 = <span class="keyword">await</span> pyppeteer.connect(&#123;<span class="string">&#x27;browserWSEndpoint&#x27;</span>: ws&#125;)</span><br><span class="line">    <span class="keyword">await</span> browser2.close()</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">asyncio.get_event_loop().run_until_complete(main())</span><br></pre></td></tr></table></figure>

<p>浏览器Browser</p>
<p>常用属性和方法：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">process：返回浏览器进程，如果浏览器实例是由 connect 方法创建的则返回 null。</span><br><span class="line">browserContexts：返回一个包含所有打开的浏览器上下文的列表。在新创建的浏览器中，这将返回 [BrowserContext]的单个实例。</span><br><span class="line">wsEndpoint: 返回 websocket 端点 url，用于connect 方法重链。</span><br><span class="line">pages()：获取所有可见的标签页。</span><br><span class="line">newPage()：新建标签页。</span><br><span class="line">close():关闭 Chromium 及其所有页面。Browser 对象本身被认为是处理过的并不能再被使用。</span><br><span class="line">disconnect()：断开 Pyppeteer 和浏览器的连接，但 Chromium 进程仍然在运行。在调用 disconnect 之后，Browser 对象本身被认为是处理过的并不能再被使用。</span><br><span class="line">createIncognitoBrowserContext()：创建一个新的隐身浏览器上下文。这不会与其他浏览器上下文共享 cookie / 缓存。</span><br><span class="line">userAgent():返回浏览器原始的 user-agent。页面可以使用 page.setUserAgent 覆盖浏览器的 user-agent。</span><br><span class="line"></span><br><span class="line">注：被 <span class="keyword">async</span> 关键字修饰的方法是异步方法，调用的时候也必须 <span class="keyword">await</span> 关键字修饰。</span><br></pre></td></tr></table></figure>

<p>示例：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> asyncio</span><br><span class="line"><span class="keyword">from</span> pyppeteer <span class="keyword">import</span> launch</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">async</span> <span class="function"><span class="keyword">def</span> <span class="title">main</span>():</span></span><br><span class="line">    browser = <span class="keyword">await</span> launch(&#123;<span class="string">&#x27;headless&#x27;</span>: <span class="literal">False</span>&#125;)</span><br><span class="line">    page = <span class="keyword">await</span> browser.newPage()</span><br><span class="line">    <span class="keyword">await</span> page.goto(<span class="string">&#x27;https://www.baidu.com&#x27;</span>)</span><br><span class="line">    print(browser.process)     <span class="comment"># 属性不被 async 关键字修饰</span></span><br><span class="line">    print(browser.wsEndpoint)</span><br><span class="line">    print(browser.browserContexts)</span><br><span class="line">    print(<span class="keyword">await</span> browser.userAgent())</span><br><span class="line">    print(<span class="keyword">await</span> browser.pages())</span><br><span class="line">    print(<span class="keyword">await</span> browser.version())</span><br><span class="line">    print(browser.targets())  <span class="comment"># 这个方法在源码中不被 async 关键字修饰</span></span><br><span class="line">    <span class="keyword">await</span> browser.close()</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">asyncio.get_event_loop().run_until_complete(main())</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">BrowserContext</span><br></pre></td></tr></table></figure>
<p>启动浏览器时，默认情况下使用单个 BrowserContext。<br>方法 browser.newPage() 在默认浏览器中创建页面背景。</p>
<p>Pyppeteer允许创建隐身浏览器(无痕模式)上下文。如下方法：<br>browser.createInnamitoBrowserContext()</p>
<p>隐身浏览器上下文不会将任何浏览器数据写入磁盘。</p>
<p>无痕模式：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> asyncio</span><br><span class="line"><span class="keyword">from</span> pyppeteer <span class="keyword">import</span> launch</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">async</span> <span class="function"><span class="keyword">def</span> <span class="title">main</span>():</span></span><br><span class="line">    <span class="comment"># 创建浏览器实例</span></span><br><span class="line">    browser = <span class="keyword">await</span> launch(&#123;<span class="string">&#x27;headless&#x27;</span>: <span class="literal">False</span>&#125;)</span><br><span class="line">    <span class="comment"># 启动无痕模式</span></span><br><span class="line">    context = <span class="keyword">await</span> browser.createIncognitoBrowserContext()</span><br><span class="line">    <span class="comment"># 新建标签页</span></span><br><span class="line">    page = <span class="keyword">await</span> context.newPage()</span><br><span class="line">    <span class="comment"># 打开目标 url</span></span><br><span class="line">    <span class="keyword">await</span> page.goto(<span class="string">&#x27;https://www.baidu.com&#x27;</span>)</span><br><span class="line">    <span class="comment"># 打印是否无痕模式</span></span><br><span class="line">    print(context.isIncognito())</span><br><span class="line">    <span class="comment"># 关闭无痕模式</span></span><br><span class="line">    <span class="keyword">await</span> context.close()</span><br><span class="line">    <span class="comment"># 关闭浏览器</span></span><br><span class="line">    <span class="keyword">await</span> browser.close()</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">asyncio.get_event_loop().run_until_complete(main())</span><br></pre></td></tr></table></figure>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/weizhen11/java/article/details/102496875">原文链接</a><br><a target="_blank" rel="noopener" href="https://blog.csdn.net/weizhen11/article/details/102497647?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param">pyppeteer页面操作</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/27/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E5%AD%A6%E4%B9%A0iftop%E6%B5%81%E9%87%8F%E7%9B%91%E6%8E%A7%EF%BC%88%E6%89%BE%E5%87%BA%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%80%97%E8%B4%B9%E6%B5%81%E9%87%8F%E6%9C%80%E5%A4%9A%E7%9A%84ip%E5%92%8C%E7%AB%AF%E5%8F%A3%EF%BC%89/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/27/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E5%AD%A6%E4%B9%A0iftop%E6%B5%81%E9%87%8F%E7%9B%91%E6%8E%A7%EF%BC%88%E6%89%BE%E5%87%BA%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%80%97%E8%B4%B9%E6%B5%81%E9%87%8F%E6%9C%80%E5%A4%9A%E7%9A%84ip%E5%92%8C%E7%AB%AF%E5%8F%A3%EF%BC%89/" class="post-title-link" itemprop="url">从零开始学习iftop流量监控（找出服务器耗费流量最多的ip和端口）</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-27 15:28:24" itemprop="dateCreated datePublished" datetime="2020-07-27T15:28:24+00:00">2020-07-27</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/27/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E5%AD%A6%E4%B9%A0iftop%E6%B5%81%E9%87%8F%E7%9B%91%E6%8E%A7%EF%BC%88%E6%89%BE%E5%87%BA%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%80%97%E8%B4%B9%E6%B5%81%E9%87%8F%E6%9C%80%E5%A4%9A%E7%9A%84ip%E5%92%8C%E7%AB%AF%E5%8F%A3%EF%BC%89/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/27/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E5%AD%A6%E4%B9%A0iftop%E6%B5%81%E9%87%8F%E7%9B%91%E6%8E%A7%EF%BC%88%E6%89%BE%E5%87%BA%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%80%97%E8%B4%B9%E6%B5%81%E9%87%8F%E6%9C%80%E5%A4%9A%E7%9A%84ip%E5%92%8C%E7%AB%AF%E5%8F%A3%EF%BC%89/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>1.9k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>2 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h2 id="一、iftop是什么"><a href="#一、iftop是什么" class="headerlink" title="一、iftop是什么"></a>一、iftop是什么</h2><p>iftop是类似于top的实时流量监控工具。</p>
<p>作用：监控网卡的实时流量（可以指定网段）、反向解析IP、显示端口信息等</p>
<p>官网：<a target="_blank" rel="noopener" href="http://www.ex-parrot.com/~pdw/iftop/">http://www.ex-parrot.com/~pdw/iftop/</a></p>
<h2 id="二、界面说明"><a href="#二、界面说明" class="headerlink" title="二、界面说明"></a>二、界面说明</h2><p>=&gt;代表发送数据，&lt;= 代表接收数据<br>TX：发送流量<br>RX：接收流量<br>TOTAL：总流量<br>Cumm：运行iftop到目前时间的总流量<br>peak：流量峰值<br>rates：分别表示过去 2s 10s 40s 的平均流量<br>##　三、常用参数<br>-i 指定需要检测的网卡， 如果有多个网络接口，则需要注意网络接口的选择，如：# iftop -i eth1<br>-B 将输出以byte为单位显示网卡流量，默认是bit<br>-n 将输出的主机信息都通过IP显示，不进行DNS解析<br>-N 只显示连接端口号，不显示端口对应的服务名称<br>-F 显示特定网段的网卡进出流量  如iftop -F 192.168.85.0/24<br>-h 帮助，显示参数信息<br>-p 以混杂模式运行iftop，此时iftop可以用作网络嗅探器 ;<br>-P 显示主机以及端口信息<br>-m 设置输出界面中最上面的流量刻度最大值，流量刻度分5个大段显示  如：# iftop -m 100M<br>-f 使用筛选码选择数据包来计数  如iftop -f filter code<br>-b 不显示流量图形条<br>-c 指定可选的配置文件   如iftop  -c config file<br>-t 使用不带ncurses的文本界面，<br>    以下两个是只和-t一起用的：<br>    -s num num秒后打印一次文本输出然后退出，-t -s 60组合使用，表示取60秒网络流量输出到终端<br>    -L num 打印的行数<br>-f 参数支持tcpdump的语法，可以使用各种过滤条件。</p>
<h2 id="四、进入界面后的操作"><a href="#四、进入界面后的操作" class="headerlink" title="四、进入界面后的操作"></a>四、进入界面后的操作</h2><p>一般参数<br>P      切换暂停/继续显示<br>h      在交互界面/状态输出界面之间切换<br>b      切换是否显示平均流量图形条<br>B      切换显示2s 10s和40s内的平均流量<br>T      切换是否显示每个连接的总流量<br>j/k    向上或向下滚动屏幕显示当前的连接信息<br>f      编辑筛选码<br>l      打开iftop输出过滤功能 ，如输入要显示的IP按回车键后屏幕就只显示与这个IP相关的流量信息<br>L      切换显示流量刻度范围，刻度不同，流量图形条也会不同<br>q      退出iftop<br>主机参数<br>n      使iftop输出结果以IP或主机名的方式显示<br>s      切换是否显示源主机信息<br>d      切换是否显示远端目标主机信息<br>t      切换输出模式,一行或多行<br>端口显示参数<br>N      切换显示端口号/端口号对应服务名称<br>S      切换是否显示本地源主机的端口信息<br>D      切换是否显示远端目标主机的端口信息<br>p      切换是否显示端口信息<br>输出排序参数<br>1/2/3  通过第一列/第二列/第三列排序<br>&lt;      根据左边的本地主机名或IP地址进行排序</p>
<blockquote>
<pre><code> 根据远端目标主机的主机名或IP地址进行排序</code></pre>
<p>o      切换是否固定显示当前的连接</p>
</blockquote>
<h2 id="五、使用示例"><a href="#五、使用示例" class="headerlink" title="五、使用示例"></a>五、使用示例</h2><p>1.显示网卡eth0的信息，主机通过ip显示<br>iftop -i eth0 -n<br>2.显示端口号（添加-P参数，进入界面可通过p参数关闭）<br>iftop -i eth0 -n -P<br>3.显示将输出以byte为单位显示网卡流量,默认是bit<br>iftop -i eth0 -n -B<br>4.显示流量进度条<br>iftop -i eth0 -n(进入界面后按下L)<br>5.显示每个连接的总流量<br>iftop -i eth0 -n(进入界面后按下T)<br>6.显示指定ip 172.17.1.158的流量<br>iftop -i eth0 -n(进入界面后按下l,输入172.17.1.158回车)</p>
<h2 id="六、实战-找出最费流量的ip和端口号"><a href="#六、实战-找出最费流量的ip和端口号" class="headerlink" title="六、实战-找出最费流量的ip和端口号"></a>六、实战-找出最费流量的ip和端口号</h2><p>网上找了一圈，全是粘贴复制的iftop命令使用，没说到点上</p>
<p>接下，请欣赏真正的表演</p>
<p>1.进入界面<br>iftop -i eth0 -nNB -m 10M<br>-i 指定网卡，<br>-n 代表主机通过ip显示不走DNS<br>-N 只显示连接端口号，不显示端口对应的服务名称(不加会显示如ssh这样的服务名称，不便于排查)<br>-B 指定显示单位为Kb，默认是bit，太小！<br>-m 设置输出界面中最上面的流量刻度最大值，流量刻度分5个大段显示<br>进入后界面如下</p>
<p>2.按下L显示流量刻度<br>L参数直接显示进度条，方便人类阅读，别说你能直接通过数字感知，小心被砍死</p>
<p>3.按下T显示总量<br>总得有个总数统计，看着方便！</p>
<p>4.按下3，根据最近40s统计排序<br>用平均值来统计最权威点</p>
<p>5.按下t，发送和接受合成一行<br>显示两行没什么意思，一行就够了！</p>
<p>6.多按几次B，查看最近2s、10s、40s的统计</p>
<p>没错，图中的172.17.1.158就是我们找到的流量用得最多的IP</p>
<p>7.筛选指定IP 172.17.1.158<br>按下l, 输入172.17.1.158，出现如下</p>
<p>回车，生效</p>
<p>这下就只看到这个ip的流量监控了</p>
<p>8.找到这个ip哪个端口流量用得最多<br>按下p,根据端口号显示</p>
<p>到这里，我们就学会了如何找出流量用得最多的ip和端口号，这么好干货你不high起来对不起哥这么用心的截图！</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/27/%E8%AF%95%E7%94%A8%E4%BA%865%E6%AC%BEBI%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/27/%E8%AF%95%E7%94%A8%E4%BA%865%E6%AC%BEBI%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7/" class="post-title-link" itemprop="url">试用了5款BI分析工具</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-27 10:43:17" itemprop="dateCreated datePublished" datetime="2020-07-27T10:43:17+00:00">2020-07-27</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/BI/" itemprop="url" rel="index"><span itemprop="name">BI</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/27/%E8%AF%95%E7%94%A8%E4%BA%865%E6%AC%BEBI%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/27/%E8%AF%95%E7%94%A8%E4%BA%865%E6%AC%BEBI%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>4.5k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>4 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>前几天，领导甩给我一个任务，考察几个BI工具，下季度立项用。</p>
<p>潜心做ETL的我，对BI只是略懂。之前上的BO，由于开发模式不适应、人员用不惯，再加上负责这块的同事走的走，一直被搁置。所以这次目标很明确，急需上手简单，维护要少，能快速反应数据结果的BI。</p>
<p>于是我花了4天时间，全网百度、翻遍各大BI产品官网，也翻遍了知乎和科技网站的口碑推荐，列选了工具测评清单：Tableau、PowerBI、MicroStrategy、Qlikview、FineBI。</p>
<p>每个工具都亲自下载使用，也悉心问了报价。由于是企业选型，考虑的因素较多，除功能和使用感受，还会注重数据整合能力、数据处理性能以及安全性方面的因素，所以大家看着参考。</p>
<p>从以下几个角度考量：</p>
<p>部署安装<br>学习教程<br>使用体验（上手难度）和需求符合度<br>产品功能<br>报价和服务</p>
<h2 id="Tableau"><a href="#Tableau" class="headerlink" title="Tableau"></a><a target="_blank" rel="noopener" href="http://www.tableau.com/">Tableau</a></h2><p>从网络上找到一个10.4的Desktop破解版，替换一个注册文件即可，或者淘宝上找…（咳咳）。Tableau还有一个Server版，Server版需要请求tableau的服务器进行交互，网上找到一个代理，给发了一点资料后就没理，主要看desktop版。</p>
<h3 id="1、-下载安装"><a href="#1、-下载安装" class="headerlink" title="1、 下载安装"></a>1、 下载安装</h3><p>百度或者官网上直接下载，类似装office一样，试用版有15天的试用期，过后会提示输入密钥，安装就和一般软件安装一样，解压压缩包，按照提示一步步做。</p>
<h3 id="2、-学习教程"><a href="#2、-学习教程" class="headerlink" title="2、 学习教程"></a>2、 学习教程</h3><p>官网有教学视频，貌似没翻译完，学到一半发现后面的还都是英文的，脑壳疼。不过视频能基本带你熟悉这个工具并入门。</p>
<p>官方貌似还出了一本书叫《人人都是数据分析师：Tableau应用实战》，就是软件教程，还提供数据源供练习，学习Tableau的必备工具书吧。</p>
<p>Tableau有个在线的可视化实例库，都是学员们的作品，这个挺好，可视化作品大家可以互相参考，可以学习人家的分析思路。</p>
<h3 id="3、-产品使用体验和需求符合度"><a href="#3、-产品使用体验和需求符合度" class="headerlink" title="3、 产品使用体验和需求符合度"></a>3、 产品使用体验和需求符合度</h3><p>Tableau可以连接数据库，或者导入excel文件数据。</p>
<p>通过拖拽数据的维度和度量到工作区，来形成可视化图表，可以改变颜色，图表类型，以及其他各种细节。很多功能都是可以拖放到工作区，通过鼠标的几下点击和拖放来实现，很简单，基本不需要代码，还会自动推荐合适的图表。</p>
<p>可视化方面个人认为Tableau还是很强大的，操作也很简单。分析这块，分组、筛选、下钻、新建数据字段需要写公式…这些还是有点难度，一般软件深入的功能都比较难，需要研究一番。</p>
<h3 id="4、-产品功能"><a href="#4、-产品功能" class="headerlink" title="4、 产品功能"></a>4、 产品功能</h3><p>此次选型重点。</p>
<p>Tableau是直接连接数据库（相当于ROLAP），以关系数据库为核心，以关系型结构进行多维数据的表示和存储，维表和事实表通过主关键字和外关键字联系在一起，形成”星型模式”。</p>
<p>好处是小数据量非常快，大数据量影响性能。取数性能依赖于机器，且Tableau在构建多张有数据关联关系的表时，需要将多张数据表拼接成一张大的宽表，复杂统计时容易产生冗余数据，直接造成性能下降。</p>
<p>数据更新</p>
<p>BI很重要的一个功能是数据更新，它是报表自动化的基础。Tableau支持增量更新，不支持定时更新。Tableau抽取的数据均保存到制作的仪表板中，增量更新不能精确到某张表，必须是对全部数据的更新，报表多了，就很麻烦。</p>
<p>银行业十分注重数据安全。感叹Tableau美中不足缺少流程和数据管理功能。</p>
<p>Tableau Desktop（桌面版） 是用来创建分析，进行数据分析的，是分析工具。tableau 的server 是用来发布分析的，发布给企业有相关权限的人，是服务器。将工作簿发布到 Tableau Server。Tableau Server 会提供基于浏览器的分析。将工作簿发布到 Tableau Server 后，其他拥有帐户的人就可以登录查看发布的工作簿。</p>
<h3 id="5、-关于选型价格"><a href="#5、-关于选型价格" class="headerlink" title="5、 关于选型价格"></a>5、 关于选型价格</h3><p>官网报价：</p>
<p>代理商也给了我一个大致的价格：</p>
<p>光产品，Desktop+Sever，一套一人加税后是11万多，每增加一人多买一个桌面版，就是15000左右，我们公司估计是3、40套，预计得7、80万，不含定制实施和维护服务。</p>
<h2 id="PowerBI"><a href="#PowerBI" class="headerlink" title="PowerBI"></a><a target="_blank" rel="noopener" href="http://powerbi.microsoft.com/">PowerBI</a></h2><p>Power BI是微软家的。如果大家熟悉Excel，应该会知道微软推出的Power Query、Power Pivot、Power View和Power Map，是Excel上非常强大的四个插件。Power BI则是微软将它们作为集合推出。如果大家熟练掌握以上四个插件，那么在Excel上也能实现部分BI，毕竟Excel是企业中人手一款的工具。</p>
<h3 id="1、下载安装"><a href="#1、下载安装" class="headerlink" title="1、下载安装"></a>1、下载安装</h3><p>Power BI的工作流是在Power BI Desktop中创建报表，将其发布到Power BI 服务，然后与其他人进行共享，让他们可以在服务中或在移动应用上查看到。</p>
<p>Desktop很简单，免费的，官网下载即可，过程同tableau。Power BI报表服务器需要另外安装。需要先安装SQL Server，然后安装报表服务器。报表服务器免费版有180天是试用期，正式版需要购买密钥。</p>
<h3 id="2、-学习教程-1"><a href="#2、-学习教程-1" class="headerlink" title="2、 学习教程"></a>2、 学习教程</h3><p>官网上只找到了学习文档，没有手把手教授的视频。</p>
<p>微信上倒是搜到很多Excel牛人组织的学习课程，可惜要钱呐~</p>
<h3 id="3、产品使用体验和需求符合度"><a href="#3、产品使用体验和需求符合度" class="headerlink" title="3、产品使用体验和需求符合度"></a>3、产品使用体验和需求符合度</h3><p>Power BI的界面很office，上面是操作工具项，左侧栏是导航栏。神似Access，所以寻找功能的时候轻车熟路。侧导航栏对应三个模块：仪表板、报表和数据集。整体流程实用流程就是读取数据集—数据清洗—数据关联—表制作—Dashboard整合仪表板。</p>
<p>可视化方面，相比Tableau，Power BI给人的感觉像是IT出身，没有特别惊艳的感觉，做出来的图表中规中矩、实用性也不错。其实真正好的数据分析，可视化只需要实用就够了。</p>
<h3 id="4、-产品功能-1"><a href="#4、-产品功能-1" class="headerlink" title="4、 产品功能"></a>4、 产品功能</h3><p>数据源</p>
<p>Power BI支持各类数据源（市面上绝大部分BI都支持，只是读取方式略有差异），除了Excel和CSV 文件，它还支持Acess、SQL数据库、Hadoop／HDFS、Spark、第三方API等。</p>
<p>数据清洗</p>
<p>Power BI有一个高级功能叫DAX（Data Analysis Expressions），是整个 Power BI 使用的公式语言。DAX近似Excel函数（大多数第三方BI，函数均接近Excel），故它针对新手非常友好。如果大家已经熟悉Excel函数，上手速度会很快，基本上函数名字都一样。</p>
<p>数据关联</p>
<p>建立表间联系这个很重要，在Excel中，大家一般用写Vlookup函数实现，Power BI则用拖拽关联数据，确实更加方便。</p>
<p>数据更新</p>
<p>BI很重要的一个功能是数据更新，它是报表自动化的基础，它通常和SQL关联。我们使用CSV，只能往里面黏贴数据更新，还是繁琐了些，只属于半自动化。</p>
<h3 id="5、-关于选型价格-1"><a href="#5、-关于选型价格-1" class="headerlink" title="5、 关于选型价格"></a>5、 关于选型价格</h3><p>官网价格（个人参考）：</p>
<p>企业部署：</p>
<p>它是按设计用户和节点卖的，按年/按月收费。估计了一下，假设200个用户的企业，40个设计用户，1年收费是45万左右，也就是每年要付出这么多，还是比较贵的。</p>
<h2 id="FineBI"><a href="#FineBI" class="headerlink" title="FineBI"></a><a target="_blank" rel="noopener" href="http://www.finebi.com/">FineBI</a></h2><p>国产BI里口碑好的就挑了这么一家，是帆软的。他家还有一个报表工具finereport，貌似做得更成熟更好，毕竟报表BI也不分家。</p>
<h3 id="1、下载安装-1"><a href="#1、下载安装-1" class="headerlink" title="1、下载安装"></a>1、下载安装</h3><p>下载和安装很简单，官网上直接下载。启动软件时会加载数据日志，但是所有操作都在web端。最初用的4.1版，后来对方工作人员给我发来了最新的5.0，说这几天会上线。</p>
<h3 id="2、学习教程"><a href="#2、学习教程" class="headerlink" title="2、学习教程"></a>2、学习教程</h3><p>激活时会发送一个学习资料包，上面有大概10多节功能教学视频。</p>
<p>还有学习帮助文档，下载激活时大家留心，记得收藏。</p>
<p>除此之外，还有个学习交流的论坛，水了几天，加了学习交流群，怪怪好多人，提问回答好积极，对像我这样的技术宅来讲是极好的。</p>
<h3 id="3、产品使用体验和需求符合度-1"><a href="#3、产品使用体验和需求符合度-1" class="headerlink" title="3、产品使用体验和需求符合度"></a>3、产品使用体验和需求符合度</h3><p>使用的过程是先配置数据源，然后建立一个所谓的业务包，应该就是数据表暂存到业务包内管理，可以按照业务分类。后面就是数据清洗、数据表关联，然后可视化分析了。</p>
<p>界面风格是清爽商务的，比较符合中国人使用门户软件、使用互联网产品的感觉，看了一遍教程基本上就可以上手了。</p>
<p>分析过程，交互啊操作思路，类似Tableau，都是维度和度量的拖拽，自动推荐合适的图表，可以更改颜色、图表类型，以及其他各种细节。</p>
<p>数据配置时有个业务包，这个和其他BI工具大不同，暂时不太了解其用处，能把数据分门别类分好。</p>
<h3 id="4、产品功能"><a href="#4、产品功能" class="headerlink" title="4、产品功能"></a>4、产品功能</h3><p>说其特有的吧。有权限管理有权限管理，有点像OA。tableau、PowerBI这个功能都要装sever版，但貌似功能也局限于分享，没有部门、人员、数据权限的设置。所以相对来讲，finebi更适合企业级使用。</p>
<p>可视化和分析功能基本同tableau，虽然我没有使用太深入，但是整体的分析操作，拖拽数据字段——生成图表——编辑dashboard，这个过程都是很像的。</p>
<p>支持进行数据抽取和数据索引建模，可显著提高数据的计算速度，可实现离线查询；支持用户进行所有数据表的数据更新；支持对数据表进行增量增加、增量删除、增量修改更新。</p>
<p>数据挖掘</p>
<p>支持对数据进行时序预测、数据聚类、数据分类（神经网络、决策树算法）三类挖掘模型算法。</p>
<p>最后，还有一个移动端，手机可查看分析。</p>
<p>###　关于选型价格</p>
<p>个人使用免费，不限功能，限并发。</p>
<p>企业部署是按照功能来售卖，一次买断。问了对方销售，报价没说太明白，需要依据功能和项目来定，产品价格在小几十万不等。送一年技术服务，一年内免费升级。</p>
<p>还有两个工具MicroStrategy和PowerBI，简单试了下，网上内容不多，且篇幅有限，就大致评价一下。</p>
<h2 id="MicroStrategy"><a href="#MicroStrategy" class="headerlink" title="MicroStrategy"></a><a target="_blank" rel="noopener" href="http://www.microstrategy.cn/cn">MicroStrategy</a></h2><p>网上下的10.11版。也是一个偏向于企业级的BI分析产品。</p>
<p>国外产品，很多资料都还是英文版，看着很吃力。使用上是先配置数据，然后选择图表，可视化展现，数据字段可以ctrl多选拖拽。</p>
<p>可视化风格和Tableau差不多，该支持的数据都能支持，就是对国内一些ERP等业务系统的数据连接并不支持。功能的话，性能我没有那么多数据也跑不起来，这块打算到现场POC再说。移动端、平板的适应做的挺好的，看他们也在大肆宣传，应该是优势之一。</p>
<p>产品拥有行业型及业务模块的方案，不过案例多是国外的，在国外用的不错。</p>
<p>报价包含产品licence费用以及服务费。产品费用按功能和用户来算，一个设计用户在16W，分析用户3~4W，web报表用户2.3W……总之价格还是蛮高的。</p>
<h2 id="Qlikview"><a href="#Qlikview" class="headerlink" title="Qlikview"></a><a target="_blank" rel="noopener" href="http://www.qlik.com/zh-cn">Qlikview</a></h2><p>不得不吐槽，国外产品在国内的网站真的是…费了老大劲找到并下载了。</p>
<p>Qlikview个人是没觉得好用，也没看出优势来，更像是一个可视化工具。像tableau、finebi可以做探索性的数据分析。qlikview比如你想拖一些数据看看结论与猜想是否正确，有时候可能要做20多个仪表盘才能验证自己的猜想，它比较适合一开始就知道怎么分析展现。</p>
<p>Qlikview也是内存型的BI，同Tableau，通病是数据处理速度很大程度上依赖内存大小，对硬件要求较高，一般企业的配置，数据处理起来较慢。</p>
<p>关于报价，国内的报价不清楚，官网也没有展示，填了表单，代理商也没有回应。</p>
<p>最后<br>个人青睐于前三个，上手都比较简单，tableau可视化最佳，powerbi可以和excel结合，finebi最符合选型需求，上手也最简单。具体的还涉及数据读取性能、集群等等，还有乙方项目这块的时间和经济成本。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/27/5%E6%AC%BE%E8%B6%85%E7%BA%A7%E7%AE%80%E5%8D%95%E7%9A%84IP%E6%B5%81%E9%87%8F%E7%9B%91%E6%8E%A7%E5%B7%A5%E5%85%B7/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/27/5%E6%AC%BE%E8%B6%85%E7%BA%A7%E7%AE%80%E5%8D%95%E7%9A%84IP%E6%B5%81%E9%87%8F%E7%9B%91%E6%8E%A7%E5%B7%A5%E5%85%B7/" class="post-title-link" itemprop="url">5款超级简单的IP流量监控工具</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-27 10:37:32" itemprop="dateCreated datePublished" datetime="2020-07-27T10:37:32+00:00">2020-07-27</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/27/5%E6%AC%BE%E8%B6%85%E7%BA%A7%E7%AE%80%E5%8D%95%E7%9A%84IP%E6%B5%81%E9%87%8F%E7%9B%91%E6%8E%A7%E5%B7%A5%E5%85%B7/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/27/5%E6%AC%BE%E8%B6%85%E7%BA%A7%E7%AE%80%E5%8D%95%E7%9A%84IP%E6%B5%81%E9%87%8F%E7%9B%91%E6%8E%A7%E5%B7%A5%E5%85%B7/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>1.5k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>1 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>对于系统管理员来说，最重要的任务之一就是密切关注网络。当有糟糕的事情发生时，起因可能就是某个卑鄙的人。有可能是黑客，被攻破的系统，或者是出故障的硬件，关键是要找出问题所在。</p>
<p>为此，你需要合适的工具。首先你可能需要用到的工具是IP流量监控工具。所幸的是，如今有很多工具可以为你服务。糟糕的是……其中一些工具还是相当复杂的。这就是为什么我要找出最简单的IP流量监控工具，并且其中5款罗列出来，为你监控网络提供帮助。</p>
<h2 id="1、Microsoft-Network-Monitor"><a href="#1、Microsoft-Network-Monitor" class="headerlink" title="1、Microsoft Network Monitor"></a>1、Microsoft Network Monitor</h2><p>Microsoft Network Monitor（如图A）可能有些过时，但它就像是一位冠军。有了MSNM，你可以轻松地为超过300种开放协议和专有协议捕获和分析网络流量包；同时运行获取对话；运行无线监控模式，混合模式或者监听模式；等等。有了Capture选项，你可以过滤获取项，这改变适配器的选项，甚至是更改全局选项。<br>这款工具让你只需要点击几下就可以快速监控网络。当你检查故障的时候，你不会看到太多花哨的功能。这款应用是免费的，支持Windows XP/Vista/7/8/2003/2008。</p>
<h2 id="2、Umit"><a href="#2、Umit" class="headerlink" title="2、Umit"></a>2、Umit</h2><p><a target="_blank" rel="noopener" href="https://sourceforge.net/projects/umit/">Umit</a>（如图B）是另外一款用于广受欢迎的nmap扫描工具的Linux前端应用。它可以很好地让任何用户使用强大的nmap工具。但是不要让简单的界面欺骗了你。Umit提供了nmap扫描器所有的强大功能和灵活性。<br>Umit可能看起来有些熟悉，因为它集成了更为流行的nmap前端，Zenmap。两者之间的主要区别是，Umit将所有必要工具放在了一个可以轻易访问到的工具栏——而Zenmao将同样的工具放到了菜单中。Umit是免费的，但是与跨平台Zenmap不同的是，它只支持Linux。</p>
<h2 id="3、Advanced-IP-Scanner"><a href="#3、Advanced-IP-Scanner" class="headerlink" title="3、Advanced IP Scanner"></a>3、Advanced IP Scanner</h2><p><a target="_blank" rel="noopener" href="https://www.advanced-ip-scanner.com/">Advanced IP Scanner</a>（如图C）是这个类别下可以作为便携式版本运行的少数工具之一。这对于大多数网络管理员来说是一个福音，因为你并不总是希望花时间来安装必要的工具来发现问题。Advanced IP Scanner让你可以访问共享文件夹以及HTTP/FTP服务器，扫描所有网络设备，提供对计算机的远程控制（通过RDP），甚至可以远程关闭计算机。<br>最重要的是，你只需要打开应用，点击开始按钮，就可以关闭或者启动扫描。Advanced IP Scanner可运行在Windows 7和8上，并且是免费的。</p>
<h2 id="4、Capsa-Free"><a href="#4、Capsa-Free" class="headerlink" title="4、Capsa Free"></a>4、Capsa Free</h2><p>Capsa Free（如图D）是由Colasoft提供的，在分析流量和IP包以及解决网络问题方面表现出色。与其他选择不同的是，Capsa Free要求你必须有许可才能激活软件。（它是免费的，但是你需要提交电子邮件地址以接收许可密钥。）<br>这款工具的免费的确存在一些Capsa Professional或者Capsa Enterprise中不会有的局限性。关于这三个版本的对比，可以查看这里。Capsa中包括更繁琐的用户界面，但是这凸显出一些出色的功能（尤其是实时绘图工具）。我强烈推荐尝试一下免费版，如果符合你的需求，可以购买专业版或者企业版得到更多强大的功能。</p>
<h2 id="5、The-Dude"><a href="#5、The-Dude" class="headerlink" title="5、The Dude"></a>5、The Dude</h2><p>由MikroTik提供的The Dude（如图E）是一款有趣的网络监控工具。它监控你的网络，如果出现问题的时候会提醒你。它还可以快速扫描你的网络并定位被发现的设备。<br>有一个很方便的功能，就是手动添加设备甚至是为每台设备设定各种类型的监控。这意味着你可以设置特定的监控以细致地观察每台连接到你的网络中的设备。The Dude是免费的，只支持Windows。</p>
<p>其他选择？</p>
<p>现在有很多可用的网络监控工具可以满足你的需求。如果你正在寻找易于使用（但是足够强大以具有生产力的话），其中一款工具肯定会符合你的预算条件。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/25/test/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/25/test/" class="post-title-link" itemprop="url">Hexo主题增加鼠标点击效果</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-25 12:04:47" itemprop="dateCreated datePublished" datetime="2020-07-25T12:04:47+00:00">2020-07-25</time>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/25/test/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/25/test/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>1.2k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>1 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>流程<br>将以下代码放到主题源文件目录下，如 /themes/yilia/source/js/ 下新建文件 click-word.js，代码见下文。<br>下载jquery文件<a target="_blank" rel="noopener" href="https://code.jquery.com/jquery-3.3.1.min.js">（目前最新版本）</a>，放到同一目录下（个人喜好）。<br>修改布局文件，/themes/next/layout/_layout.ejs，在末尾body中添加</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/07/25/test/#more" rel="contents">
                Read more &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/24/Docker-%E6%9C%AC%E5%9C%B0%E5%AF%BC%E5%85%A5%E9%95%9C%E5%83%8F-%E4%BF%9D%E5%AD%98%E9%95%9C%E5%83%8F-%E8%BD%BD%E5%85%A5%E9%95%9C%E5%83%8F-%E5%88%A0%E9%99%A4%E9%95%9C%E5%83%8F/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/24/Docker-%E6%9C%AC%E5%9C%B0%E5%AF%BC%E5%85%A5%E9%95%9C%E5%83%8F-%E4%BF%9D%E5%AD%98%E9%95%9C%E5%83%8F-%E8%BD%BD%E5%85%A5%E9%95%9C%E5%83%8F-%E5%88%A0%E9%99%A4%E9%95%9C%E5%83%8F/" class="post-title-link" itemprop="url">Docker 本地导入镜像/保存镜像/载入镜像/删除镜像</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-24 19:39:05" itemprop="dateCreated datePublished" datetime="2020-07-24T19:39:05+00:00">2020-07-24</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Docker/" itemprop="url" rel="index"><span itemprop="name">Docker</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/24/Docker-%E6%9C%AC%E5%9C%B0%E5%AF%BC%E5%85%A5%E9%95%9C%E5%83%8F-%E4%BF%9D%E5%AD%98%E9%95%9C%E5%83%8F-%E8%BD%BD%E5%85%A5%E9%95%9C%E5%83%8F-%E5%88%A0%E9%99%A4%E9%95%9C%E5%83%8F/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/24/Docker-%E6%9C%AC%E5%9C%B0%E5%AF%BC%E5%85%A5%E9%95%9C%E5%83%8F-%E4%BF%9D%E5%AD%98%E9%95%9C%E5%83%8F-%E8%BD%BD%E5%85%A5%E9%95%9C%E5%83%8F-%E5%88%A0%E9%99%A4%E9%95%9C%E5%83%8F/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>1.1k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>1 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h1 id="1、Docker导入本地镜像"><a href="#1、Docker导入本地镜像" class="headerlink" title="1、Docker导入本地镜像"></a>1、Docker导入本地镜像</h1><p>有时候我们自己在本地或者其它小伙伴电脑上拷贝了一份镜像，有了这个镜像之后，我们可以把本地的镜像导入，使用docker import 命令。</p>
<p>例如这里下载了一个 alibaba-rocketmq-3.2.6.tar.gz 镜像文件，使用下列命令导入：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">[root@rocketmq-nameserver4 dev]<span class="comment"># cat alibaba-rocketmq-3.2.6.tar.gz | docker import - rocketmq:3.2.6(镜像名自己定义)</span></span><br><span class="line">[root@rocketmq-nameserver4 dev]<span class="comment"># docker images</span></span><br><span class="line">REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE</span><br><span class="line">rocketmq                     <span class="number">3.2</span><span class="number">.6</span>               53925d1cf9f0        <span class="number">23</span> seconds ago      14MB</span><br><span class="line">my/python                    v1                  36b6e288656c        <span class="number">2</span> days ago          281MB</span><br><span class="line">my/centos_width_python       v1<span class="number">.0</span><span class="number">.1</span>              36b6e288656c        <span class="number">2</span> days ago          281MB</span><br><span class="line">my/sinatra                   v2                  8ba1d6a3ce4e        <span class="number">2</span> days ago          453MB</span><br><span class="line">hello-world                  latest              725dcfab7d63        <span class="number">4</span> months ago        <span class="number">1.84</span>kB</span><br></pre></td></tr></table></figure>
<p>​<br>可以看到导入完成后，docker为我们生成了一个镜像ID，使用docker images也可以看到我们刚刚从本地导入的镜像。</p>
<p>注意镜像文件必须是tar.gz类型的文件。</p>
<h1 id="2、保存镜像"><a href="#2、保存镜像" class="headerlink" title="2、保存镜像"></a>2、保存镜像</h1><p>先根据已有的这个容器来提交一个新的镜像，提交时需要用到容器ID。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker commit –m “rocketmq” –a “zmc” d8990fec2141 rocketmq</span><br></pre></td></tr></table></figure>
<p>我们的镜像做好之后，我们要保存起来，以供备份使用，该怎么做？使用docker save命令，保存镜像到本地。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@rocketmq-nameserver4 dev]<span class="comment"># docker save -o rocketmq.tar rocketmq ##-o：指定保存的镜像的名字；rocketmq.tar：保存到本地的镜像名称；rocketmq：镜像名字，通过&quot;docker images&quot;查看</span></span><br><span class="line">[root@rocketmq-nameserver4 dev]<span class="comment"># ll </span></span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>rocketmq.tar为刚保存的镜像</p>
<h1 id="3、载入镜像"><a href="#3、载入镜像" class="headerlink" title="3、载入镜像"></a>3、载入镜像</h1><p>我们有了本地的镜像文件，在需要的时候可以使用docker load将本地保存的镜像再次导入docker中。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker load --<span class="built_in">input</span> rocketmq.tar 或 docker load &lt; rocketmq.tar</span><br></pre></td></tr></table></figure>


<h1 id="4、删除镜像"><a href="#4、删除镜像" class="headerlink" title="4、删除镜像"></a>4、删除镜像</h1><p>有些镜像过时了，我们需要删除。使用如下的命令：docker rmi -f image_id ##-f：表示强制删除镜像；image_id：镜像id</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/24/ubuntu20-04-%E5%AE%89%E8%A3%9D%E9%85%8D%E7%BD%AEvnc-x11vnc-server/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/24/ubuntu20-04-%E5%AE%89%E8%A3%9D%E9%85%8D%E7%BD%AEvnc-x11vnc-server/" class="post-title-link" itemprop="url">ubuntu20.04 安裝配置vnc  x11vnc server</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-24 18:16:03" itemprop="dateCreated datePublished" datetime="2020-07-24T18:16:03+00:00">2020-07-24</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/24/ubuntu20-04-%E5%AE%89%E8%A3%9D%E9%85%8D%E7%BD%AEvnc-x11vnc-server/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/24/ubuntu20-04-%E5%AE%89%E8%A3%9D%E9%85%8D%E7%BD%AEvnc-x11vnc-server/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>8.9k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>8 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>Ubuntu 20.04 VNC 安装与设置</p>
<p>VNC是一个远程桌面协议。按照本文的说明进行操作可以实现用VNC对Ubuntu 20.04进行远程控制。一般的VNC安装方式在主机没有插显示器的时候是无法使用的。下面的操作可以在主机有显示器和没有显示器时都能够正常工作。</p>
<p>首先安装x11vnc</p>
<pre><code class="bash">sudo apt-get install x11vnc -y
</code></pre>
<p>设置vnc密码</p>
<pre><code class="bash">sudo x11vnc -storepasswd /etc/x11vnc.pass 
</code></pre>
<p>创建x11vnc自启动服务</p>
<p>创建 /etc/systemd/system/x11vnc.service，并写入以下内容</p>
<pre><code class="bash">[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth /run/user/1000/gdm/Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
</code></pre>
<p>启动x11vnc服务</p>
<pre><code class="bash">sudo systemctl enable x11vnc
sudo service x11vnc start
</code></pre>
<p>此时如果远程的主机上接了显示器，那么就可以在局域网通过VNC进行访问了。</p>
<p>为了能够保证远程主机无论是否有显示器，我们都能通过VNC进行远程访问，我们还要做下面的修改</p>
<p>创建默认的xorg.conf文件</p>
<pre><code class="bash">sudo Xorg :1 -configure
</code></pre>
<p>此时程序会生成 /root/xorg.conf.new文件<br>我的默认文件内容如下</p>
<pre><code class="bash">Section &quot;ServerLayout&quot;
    Identifier     &quot;X.org Configured&quot;
    Screen      0  &quot;Screen0&quot; 0 0
    InputDevice    &quot;Mouse0&quot; &quot;CorePointer&quot;
    InputDevice    &quot;Keyboard0&quot; &quot;CoreKeyboard&quot;
EndSection

Section &quot;Files&quot;
    ModulePath   &quot;/usr/lib/xorg/modules&quot;
    FontPath     &quot;/usr/share/fonts/X11/misc&quot;
    FontPath     &quot;/usr/share/fonts/X11/cyrillic&quot;
    FontPath     &quot;/usr/share/fonts/X11/100dpi/:unscaled&quot;
    FontPath     &quot;/usr/share/fonts/X11/75dpi/:unscaled&quot;
    FontPath     &quot;/usr/share/fonts/X11/Type1&quot;
    FontPath     &quot;/usr/share/fonts/X11/100dpi&quot;
    FontPath     &quot;/usr/share/fonts/X11/75dpi&quot;
    FontPath     &quot;built-ins&quot;
EndSection

Section &quot;Module&quot;
    Load  &quot;glx&quot;
EndSection

Section &quot;InputDevice&quot;
    Identifier  &quot;Keyboard0&quot;
    Driver      &quot;kbd&quot;
EndSection

Section &quot;InputDevice&quot;
    Identifier  &quot;Mouse0&quot;
    Driver      &quot;mouse&quot;
    Option        &quot;Protocol&quot; &quot;auto&quot;
    Option        &quot;Device&quot; &quot;/dev/input/mice&quot;
    Option        &quot;ZAxisMapping&quot; &quot;4 5 6 7&quot;
EndSection

Section &quot;Monitor&quot;
    Identifier   &quot;Monitor0&quot;
    VendorName   &quot;Monitor Vendor&quot;
    ModelName    &quot;Monitor Model&quot;
EndSection

Section &quot;Device&quot;
        ### Available Driver options are:-
        ### Values: &lt;i&gt;: integer, &lt;f&gt;: float, &lt;bool&gt;: &quot;True&quot;/&quot;False&quot;,
        ### &lt;string&gt;: &quot;String&quot;, &lt;freq&gt;: &quot;&lt;f&gt; Hz/kHz/MHz&quot;,
        ### &lt;percent&gt;: &quot;&lt;f&gt;%&quot;
        ### [arg]: arg optional
        #Option     &quot;Accel&quot;                  # [&lt;bool&gt;]
        #Option     &quot;AccelMethod&quot;            # &lt;str&gt;
        #Option     &quot;Backlight&quot;              # &lt;str&gt;
        #Option     &quot;CustomEDID&quot;             # &lt;str&gt;
        #Option     &quot;DRI&quot;                    # &lt;str&gt;
        #Option     &quot;Present&quot;                # [&lt;bool&gt;]
        #Option     &quot;ColorKey&quot;               # &lt;i&gt;
        #Option     &quot;VideoKey&quot;               # &lt;i&gt;
        #Option     &quot;Tiling&quot;                 # [&lt;bool&gt;]
        #Option     &quot;LinearFramebuffer&quot;      # [&lt;bool&gt;]
        #Option     &quot;HWRotation&quot;             # [&lt;bool&gt;]
        #Option     &quot;VSync&quot;                  # [&lt;bool&gt;]
        #Option     &quot;PageFlip&quot;               # [&lt;bool&gt;]
        #Option     &quot;SwapbuffersWait&quot;        # [&lt;bool&gt;]
        #Option     &quot;TripleBuffer&quot;           # [&lt;bool&gt;]
        #Option     &quot;XvPreferOverlay&quot;        # [&lt;bool&gt;]
        #Option     &quot;HotPlug&quot;                # [&lt;bool&gt;]
        #Option     &quot;ReprobeOutputs&quot;         # [&lt;bool&gt;]
        #Option     &quot;XvMC&quot;                   # [&lt;bool&gt;]
        #Option     &quot;ZaphodHeads&quot;            # &lt;str&gt;
        #Option     &quot;VirtualHeads&quot;           # &lt;i&gt;
        #Option     &quot;TearFree&quot;               # [&lt;bool&gt;]
        #Option     &quot;PerCrtcPixmaps&quot;         # [&lt;bool&gt;]
        #Option     &quot;FallbackDebug&quot;          # [&lt;bool&gt;]
        #Option     &quot;DebugFlushBatches&quot;      # [&lt;bool&gt;]
        #Option     &quot;DebugFlushCaches&quot;       # [&lt;bool&gt;]
        #Option     &quot;DebugWait&quot;              # [&lt;bool&gt;]
        #Option     &quot;BufferCache&quot;            # [&lt;bool&gt;]
    Identifier  &quot;Card0&quot;
    Driver      &quot;intel&quot;
    BusID       &quot;PCI:0:2:0&quot;
EndSection

Section &quot;Screen&quot;
    Identifier &quot;Screen0&quot;
    Device     &quot;Card0&quot;
    Monitor    &quot;Monitor0&quot;
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     1
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     4
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     8
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     15
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     16
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection
</code></pre>
<p>将此文件复制至 /usr/share/X11/xorg.conf.d/xorg.conf</p>
<p>这个文件保证在主机上插有显示器的时候，系统界面能在显示器上正常显示。下面我们再给系统添加一个虚拟显示器，当主机没有显示器的时候系统就使用这个虚拟显示器。</p>
<p>安装虚拟显卡驱动</p>
<pre><code class="bash">sudo apt install xserver-xorg-video-dummy
</code></pre>
<p>在这个文件的最后添加下面的内容</p>
<pre><code class="bash">Section &quot;Monitor&quot;
  Identifier &quot;Monitor1&quot;
  HorizSync   1.0 - 2000.0
  VertRefresh 1.0 - 200.0
  # Add 16:9 modes, others are automatically detected.
  Modeline &quot;1280x720&quot; 74.48 1280 1336 1472 1664 720 721 724 746
  Modeline &quot;1920x1080&quot; 172.80 1920 2040 2248 2576 1080 1081 1084 1118
EndSection


Section &quot;Device&quot;
  Identifier &quot;Card1&quot;
  Driver &quot;dummy&quot;
  VideoRam 256000
EndSection

Section &quot;Screen&quot;
  DefaultDepth 24
  Identifier &quot;Screen1&quot;
  Device &quot;Card1&quot;
  Monitor &quot;Monitor1&quot;
  SubSection &quot;Display&quot;
    Depth 24
    Modes &quot;1920x1080&quot;
  EndSubSection
EndSection
</code></pre>
<p>这样我们就创建了一个使用虚拟显卡的虚拟显示器。为了让虚拟的显示器和真实显示器都能工作，我们需要把最上面的 ServerLayout 进行更改</p>
<pre><code class="bash">Section &quot;ServerLayout&quot;
        Identifier     &quot;X.org Configured&quot;
        Screen      0  &quot;Screen0&quot; 0 0
    Screen      1  &quot;Screen1&quot; 0 0
EndSection
</code></pre>
<p>完整的/usr/share/X11/xorg.conf.d/xorg.conf</p>
<pre><code class="bash">Section &quot;ServerLayout&quot;
    Identifier     &quot;X.org Configured&quot;
    Screen      0  &quot;Screen0&quot; 0 0
    Screen      1  &quot;Screen1&quot; 0 0
#    InputDevice    &quot;Mouse0&quot; &quot;CorePointer&quot;
#    InputDevice    &quot;Keyboard0&quot; &quot;CoreKeyboard&quot;
EndSection

Section &quot;Files&quot;
    ModulePath   &quot;/usr/lib/xorg/modules&quot;
    FontPath     &quot;/usr/share/fonts/X11/misc&quot;
    FontPath     &quot;/usr/share/fonts/X11/cyrillic&quot;
    FontPath     &quot;/usr/share/fonts/X11/100dpi/:unscaled&quot;
    FontPath     &quot;/usr/share/fonts/X11/75dpi/:unscaled&quot;
    FontPath     &quot;/usr/share/fonts/X11/Type1&quot;
    FontPath     &quot;/usr/share/fonts/X11/100dpi&quot;
    FontPath     &quot;/usr/share/fonts/X11/75dpi&quot;
    FontPath     &quot;built-ins&quot;
EndSection

Section &quot;Module&quot;
    Load  &quot;glx&quot;
EndSection

Section &quot;InputDevice&quot;
    Identifier  &quot;Keyboard0&quot;
    Driver      &quot;kbd&quot;
EndSection

Section &quot;InputDevice&quot;
    Identifier  &quot;Mouse0&quot;
    Driver      &quot;mouse&quot;
    Option        &quot;Protocol&quot; &quot;auto&quot;
    Option        &quot;Device&quot; &quot;/dev/input/mice&quot;
    Option        &quot;ZAxisMapping&quot; &quot;4 5 6 7&quot;
EndSection

Section &quot;Monitor&quot;
    Identifier   &quot;Monitor0&quot;
    VendorName   &quot;Monitor Vendor&quot;
    ModelName    &quot;Monitor Model&quot;
EndSection

Section &quot;Device&quot;
        ### Available Driver options are:-
        ### Values: &lt;i&gt;: integer, &lt;f&gt;: float, &lt;bool&gt;: &quot;True&quot;/&quot;False&quot;,
        ### &lt;string&gt;: &quot;String&quot;, &lt;freq&gt;: &quot;&lt;f&gt; Hz/kHz/MHz&quot;,
        ### &lt;percent&gt;: &quot;&lt;f&gt;%&quot;
        ### [arg]: arg optional
        #Option     &quot;Accel&quot;                  # [&lt;bool&gt;]
        #Option     &quot;AccelMethod&quot;            # &lt;str&gt;
        #Option     &quot;Backlight&quot;              # &lt;str&gt;
        #Option     &quot;CustomEDID&quot;             # &lt;str&gt;
        #Option     &quot;DRI&quot;                    # &lt;str&gt;
        #Option     &quot;Present&quot;                # [&lt;bool&gt;]
        #Option     &quot;ColorKey&quot;               # &lt;i&gt;
        #Option     &quot;VideoKey&quot;               # &lt;i&gt;
        #Option     &quot;Tiling&quot;                 # [&lt;bool&gt;]
        #Option     &quot;LinearFramebuffer&quot;      # [&lt;bool&gt;]
        #Option     &quot;HWRotation&quot;             # [&lt;bool&gt;]
        #Option     &quot;VSync&quot;                  # [&lt;bool&gt;]
        #Option     &quot;PageFlip&quot;               # [&lt;bool&gt;]
        #Option     &quot;SwapbuffersWait&quot;        # [&lt;bool&gt;]
        #Option     &quot;TripleBuffer&quot;           # [&lt;bool&gt;]
        #Option     &quot;XvPreferOverlay&quot;        # [&lt;bool&gt;]
        #Option     &quot;HotPlug&quot;                # [&lt;bool&gt;]
        #Option     &quot;ReprobeOutputs&quot;         # [&lt;bool&gt;]
        #Option     &quot;XvMC&quot;                   # [&lt;bool&gt;]
        #Option     &quot;ZaphodHeads&quot;            # &lt;str&gt;
        #Option     &quot;VirtualHeads&quot;           # &lt;i&gt;
        #Option     &quot;TearFree&quot;               # [&lt;bool&gt;]
        #Option     &quot;PerCrtcPixmaps&quot;         # [&lt;bool&gt;]
        #Option     &quot;FallbackDebug&quot;          # [&lt;bool&gt;]
        #Option     &quot;DebugFlushBatches&quot;      # [&lt;bool&gt;]
        #Option     &quot;DebugFlushCaches&quot;       # [&lt;bool&gt;]
        #Option     &quot;DebugWait&quot;              # [&lt;bool&gt;]
        #Option     &quot;BufferCache&quot;            # [&lt;bool&gt;]
    Identifier  &quot;Card0&quot;
    Driver      &quot;intel&quot;
    BusID       &quot;PCI:0:2:0&quot;
EndSection

Section &quot;Screen&quot;
    Identifier &quot;Screen0&quot;
    Device     &quot;Card0&quot;
    Monitor    &quot;Monitor0&quot;
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     1
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     4
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     8
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     15
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     16
    EndSubSection
    SubSection &quot;Display&quot;
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection



Section &quot;Monitor&quot;

  Identifier &quot;Monitor1&quot;

  HorizSync   1.0 - 2000.0

  VertRefresh 1.0 - 200.0

  # Add 16:9 modes, others are automatically detected.

  Modeline &quot;1280x720&quot; 74.48 1280 1336 1472 1664 720 721 724 746

  Modeline &quot;1920x1080&quot; 172.80 1920 2040 2248 2576 1080 1081 1084 1118

EndSection





Section &quot;Device&quot;

  Identifier &quot;Card1&quot;

  Driver &quot;dummy&quot;

  VideoRam 256000

EndSection



Section &quot;Screen&quot;

  DefaultDepth 24

  Identifier &quot;Screen1&quot;

  Device &quot;Card1&quot;

  Monitor &quot;Monitor1&quot;

  SubSection &quot;Display&quot;

    Depth 24

    Modes &quot;1920x1080&quot;

  EndSubSection

EndSection
</code></pre>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/frozennet/article/details/105211375?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.channel_param">设置X11VNC后就可以使用了</a><br>现在重新启动远程电脑，就可以在没有显示器的情况下远程了。</p>
<p>以上的方法还有一个问题。就是在用户没有登录的其情况下是没办法远程的。所以需要把用户设置成自动登录。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/24/tar-%E5%91%BD%E4%BB%A4/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/24/tar-%E5%91%BD%E4%BB%A4/" class="post-title-link" itemprop="url">tar 命令</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-24 17:19:07" itemprop="dateCreated datePublished" datetime="2020-07-24T17:19:07+00:00">2020-07-24</time>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/24/tar-%E5%91%BD%E4%BB%A4/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/24/tar-%E5%91%BD%E4%BB%A4/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>1.1k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>1 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h2 id="tar压缩解压缩命令详解"><a href="#tar压缩解压缩命令详解" class="headerlink" title="tar压缩解压缩命令详解"></a>tar压缩解压缩命令详解</h2><h3 id="tar命令详解"><a href="#tar命令详解" class="headerlink" title="tar命令详解"></a>tar命令详解</h3><p>-c: 建立压缩档案</p>
<p>-x：解压</p>
<p>-t：查看内容</p>
<p>-r：向压缩归档文件末尾追加文件</p>
<p>-u：更新原压缩包中的文件</p>
<p>这五个是独立的命令，压缩解压都要用到其中一个，可以和别的命令连用但只能用其中一个。</p>
<p>下面的参数是根据需要在压缩或解压档案时可选的。</p>
<p>-z：有gzip属性的</p>
<p>-j：有bz2属性的</p>
<p>-Z：有compress属性的</p>
<p>-v：显示所有过程</p>
<p>-O：将文件解开到标准输出</p>
<p>参数-f是必须的</p>
<p>-f: 使用档案名字，切记，这个参数是最后一个参数，后面只能接档案名。</p>
<pre><code class="bash"># tar -cf all.tar *.jpg 这条命令是将所有.jpg的文件打成一个名为all.tar的包。-c是表示产生新的包，-f指定包的文件名。
# tar -rf all.tar *.gif 这条命令是将所有.gif的文件增加到all.tar的包里面去。-r是表示增加文件的意思。 
# tar -uf all.tar logo.gif 这条命令是更新原来tar包all.tar中logo.gif文件，-u是表示更新文件的意思。 
# tar -tf all.tar 这条命令是列出all.tar包中所有文件，-t是列出文件的意思 
# tar -xf all.tar 这条命令是解出all.tar包中所有文件，-x是解开的意思
</code></pre>
<h3 id="查看"><a href="#查看" class="headerlink" title="查看"></a>查看</h3><p>tar -tf aaa.tar.gz   在不解压的情况下查看压缩包的内容</p>
<h3 id="压缩"><a href="#压缩" class="headerlink" title="压缩"></a>压缩</h3><p>tar –cvf jpg.tar *.jpg //将目录里所有jpg文件打包成tar.jpg</p>
<p>tar –czf jpg.tar.gz *.jpg //将目录里所有jpg文件打包成jpg.tar后，并且将其用gzip压缩，生成一个gzip压缩过的包，命名为jpg.tar.gz</p>
<p>tar –cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后，并且将其用bzip2压缩，生成一个bzip2压缩过的包，命名为jpg.tar.bz2</p>
<p>tar –cZf jpg.tar.Z *.jpg   //将目录里所有jpg文件打包成jpg.tar后，并且将其用compress压缩，生成一个umcompress压缩过的包，命名为jpg.tar.Z</p>
<h3 id="解压"><a href="#解压" class="headerlink" title="解压"></a>解压</h3><p>tar –xvf file.tar //解压 tar包</p>
<p>tar -xzvf file.tar.gz //解压tar.gz</p>
<p>tar -xjvf file.tar.bz2   //解压 tar.bz2tar –xZvf file.tar.Z //解压tar.Z</p>
<h3 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h3><p>1、*.tar 用 tar –xvf 解压</p>
<p>2、*.gz 用 gzip -d或者gunzip 解压</p>
<p>3、*.tar.gz和*.tgz 用 tar –xzf 解压</p>
<p>4、*.bz2 用 bzip2 -d或者用bunzip2 解压</p>
<p>5、*.tar.bz2用tar –xjf 解压</p>
<p>6、*.Z 用 uncompress 解压</p>
<p>7、*.tar.Z 用tar –xZf 解压</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/24/ubuntu20-04-%E9%85%8D%E7%BD%AE%E5%92%8C%E5%AE%89%E8%A3%9Dvnc/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/24/ubuntu20-04-%E9%85%8D%E7%BD%AE%E5%92%8C%E5%AE%89%E8%A3%9Dvnc/" class="post-title-link" itemprop="url">ubuntu20.04 配置和安裝vnc</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-24 16:47:47" itemprop="dateCreated datePublished" datetime="2020-07-24T16:47:47+00:00">2020-07-24</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/24/ubuntu20-04-%E9%85%8D%E7%BD%AE%E5%92%8C%E5%AE%89%E8%A3%9Dvnc/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/24/ubuntu20-04-%E9%85%8D%E7%BD%AE%E5%92%8C%E5%AE%89%E8%A3%9Dvnc/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>4.2k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>4 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>现今，云服务器已经十分普及，申请个云服务器作为个人开发学习或者简单个人服务器使用已经司空见惯。Linux云服务器申请就绪后，一般都是命令行的，不包含桌面环境，也不支持通过远程桌面的方式访问图形化桌面环境。本指南介绍了在Ubuntu 20.04 系统上安装和配置 VNC 服务器所需的步骤，实现通过远程桌面管理和控制Ubuntu云服务器，支持图形界面操作。</p>
<p>先决条件</p>
<p>在继续学习本教程之前，请确保以具有 sudo 权限的用户身份登录。建议使用具有sudo权限的普通用户进行处理，而不是直接使用root用户。创建用户并加入sudoers可自行百度。</p>
<p>安装桌面环境</p>
<p>大多数服务器没有安装桌面环境，因此我们首先要安装轻量级桌面环境。</p>
<p>Ubuntu 存储库中有几个桌面环境，远程桌面管理建议选择安装 Xfce 。它是快速，稳定和轻量级的桌面环境，非常适合在远程服务器上使用。</p>
<p>首先使用以下命令更新系统</p>
<pre><code class="bash">
sudo apt update
sudo apt upgrade
</code></pre>
<p>然后，键入以下命令以在服务器上安装 Xfce ：</p>
<pre><code class="bash">sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils
</code></pre>
<p>根据您的系统，下载和安装 Xfce 软件包可能需要一些时间。</p>
<p>安装 VNC 服务器</p>
<p>Ubuntu 存储库中还有几种不同的 VNC 服务器，如 TightVNC ， TigerVNC 和 x11vnc 。每个 VNC 服务器在速度和安全性方面都有不同的优点和缺点。</p>
<p>我们将安装 TigerVNC ，它是高性能 VNC 服务器，并被积积极维护。</p>
<p>键入以下命令以在 Ubuntu 服务器上安装 TigerVNC ：</p>
<pre><code class="bash">sudo apt install tigervnc-standalone-server tigervnc-common
</code></pre>
<p>现在安装了 VNC 服务器，下一步是运行 vncserver 命令，该命令将创建初始配置并设置密码。运行以下命令时不要使用 sudo ：</p>
<pre><code class="bash">
vncserver
</code></pre>
<p>系统将提示您输入并确认密码，以及是否将其设置为仅查看密码。如果您选择设置仅查看密码，则用户将无法使用鼠标和键盘与 VNC 实例进行交互。</p>
<pre><code class="bash">You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
/usr/bin/xauth:  file /home/typhoon/.Xauthority does not exist
New &#39;server2.typhoon.org:1 (typhoon)&#39; desktop at :1 on machine server2.typhoon.org
Starting applications specified in /etc/X11/Xvnc-session
Log file is /home/typhoon/.vnc/server2.typhoon.org:1.log
Use xtigervncviewer -SecurityTypes VncAuth -passwd /home/typhoon/.vnc/passwd :1 to connect to the VNC server.

</code></pre>
<p>第一次 vncserver 运行命令时，它将创建密码文件并将其存储在 ~/.vnc 目录中，如果不存在，将创建该目录。</p>
<p>注意上面输出中主机名之后的 :1 。这表示运行 vnc 服务器的显示端口号。在我们的例子中，服务器在 TCP 端口 5901 (5900 + 1)上运行。如果您创建第二个实例， vncserver 它将在下一个空闲端口上运行，即 :2 这意味着服务器正在端口 5902 (5900 + 2)上运行。</p>
<p>重要的是要记住，当使用 VNC 服务器时， :X 是一个引用的显示端口 5900+X 。</p>
<p>注：如果启动时出现vnc启动异常： is taken because of /tmp/.X11-unix/X1</p>
<p>此时只需要将提示的文件删除即可。再次输入 vncserver。</p>
<p>在继续下一步之前，首先使用带有 -kill 选项和服务器编号作为参数的 vncserver 命令停止 VNC 实例。在我们的例子中，服务器在端口 5901 (:1)中运行，因此我们将使用以下命令停止它：</p>
<pre><code class="bash">
vncserver -kill :1
</code></pre>
<p>Killing Xtigervnc process ID 7264… success!<br>配置 VNC 服务器</p>
<p>现在我们已经在服务器上安装了 Xfce 和 TigerVNC ，我们需要配置 TigerVNC 来使用 Xfce 。为此，请创建以下文件 〜/.vnc/xstartup：</p>
<pre><code class="bash">
nano ~/.vnc/xstartup


#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4 

</code></pre>
<p>保存并关闭文件。无论何时启动或重启 TigerVNC 服务器，都将自动执行上述命令。</p>
<p>~/.vnc/xstartup 文件还需要具有执行权限。运行以下命令以确保权限正确：</p>
<pre><code class="bash">
chmod u+x ~/.vnc/xstartup
</code></pre>
<p>如果需要将附加选项传递给 VNC 服务器，则可以创建一个名为 config 的文件，并为每行添加一个选项。这是一个例子：</p>
<p>文件 ~/.vnc/config</p>
<p>geometry=1920x1084<br>dpi=96</p>
<p>创建 Systemd 单元文件</p>
<p>我们将创建一个 systemd 单元文件，使我们能够根据需要轻松启动，停止和重新启动 VNC 服务，与任何其他 systemd 服务相同。</p>
<p>打开文本编辑器，将以下配置复制并粘贴到其中。</p>
<pre><code class="bash">

sudo nano /etc/systemd/system/vncserver@.service
</code></pre>
<p>请务必更改第 7 行中的用户名以匹配您的用户名。</p>
<pre><code class="bash">[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
User=username
PAMName=login
PIDFile=/home/%u/.vnc/%H%i.pid
ExecStartPre=/bin/sh -c &#39;/usr/bin/vncserver -kill :%i &gt; /dev/null 2&gt;&amp;1 || :&#39;
ExecStart=/usr/bin/vncserver :%i -geometry 1440x900 -alwaysshared -fg
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

</code></pre>
<p>保存并关闭文件。</p>
<p>通知 systemd 我们创建了一个新的单元文件：</p>
<pre><code class="bash">
sudo systemctl daemon-reload
</code></pre>
<p>下一步是使用以下命令启用单元文件：</p>
<pre><code class="bash">sudo systemctl enable vncserver@1.service
</code></pre>
<p>符号 1 后面的数字 @ 定义了运行 VNC 服务的显示端口。这意味着 VNC 服务器将侦听端口 5901 ，正如我们在上一节中讨论的那样。</p>
<p>执行以下命令启动 VNC 服务：</p>
<pre><code class="bash">
sudo systemctl start vncserver@1.service

</code></pre>
<p>验证服务是否已成功启动：</p>
<pre><code class="bash">
sudo systemctl status vncserver@1.service

</code></pre>
<p>● <a href="mailto:&#118;&#x6e;&#x63;&#115;&#101;&#x72;&#118;&#x65;&#x72;&#x40;&#49;&#46;&#115;&#101;&#x72;&#118;&#105;&#x63;&#101;">&#118;&#x6e;&#x63;&#115;&#101;&#x72;&#118;&#x65;&#x72;&#x40;&#49;&#46;&#115;&#101;&#x72;&#118;&#105;&#x63;&#101;</a> - Remote desktop service (VNC)<br>   Loaded: loaded (/etc/systemd/system/vncserver@.service; indirect; vendor preset: enabled)<br>   Active: active (running) since Thu 2018-08-16 19:05:54 UTC; 4s ago<br>  Process: 9893 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill :1 &gt; /dev/null 2&gt;&amp;1 || : (code=exited, status=0/SUCCESS)<br> Main PID: 9900 (vncserver)<br>    Tasks: 0 (limit: 507)<br>   CGroup: /system.slice/system-vncserver.slice/vncserver@1.service<br>           ‣ 9900 /usr/bin/perl /usr/bin/vncserver :1 -geometry 1440x900 -alwaysshared -fg</p>
<p>连接到 VNC 服务器</p>
<p>VNC 不是加密协议，可以进行数据包嗅探。建议的方法是创建一个 SSH 隧道，该隧道将安全地将来自本地计算机的端口 5901 上的流量转发到同一端口上的服务器。</p>
<p>在 Linux 和 macOS 上设置 SSH 隧道</p>
<p>如果在计算机上运行 Linux ， macOS 或任何其他基于 Unix 的操作系统，则可以使用以下命令轻松创建 SSH 隧道：</p>
<pre><code class="bash">
ssh -L 5901:127.0.0.1:5901 -N -f -l username server_ip_address

</code></pre>
<p>系统将提示您输入用户密码。</p>
<p>该-L开关指定的端口绑定。在这种情况下，我们将5901远程连接的端口5901绑定到本地计算机上的端口。该-C开关启用压缩，而-N开关告诉ssh我们不希望执行远程命令。该-l开关指定远程登录名。</p>
<p>记得替换username，并server_ip_address与您的服务器的须藤非root用户名和IP地址。</p>
<p>如果您使用的是图形化SSH客户端（如PuTTY），请将server_ip_address用作连接IP，并在程序的SSH隧道设置中设置localhost:5901为新的转发端口。</p>
<p>隧道运行后，使用VNC客户端进行连接localhost:5901。系统将提示您使用在步骤1中设置的密码进行身份验证。</p>
<p>连接后，您将看到默认的Xfce桌面。它应该看起来像这样：<br><a target="_blank" rel="noopener" href="https://xie.infoq.cn/article/cf473dc0dea917b0b2a546ecd">安装配置vnc</a><br><a target="_blank" rel="noopener" href="https://blog.csdn.net/yang_hui1986527/article/details/106311024?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param">如何在Ubuntu 20.04 上安装 Xrdp 服务器（远程桌面）</a><br><a target="_blank" rel="noopener" href="https://blog.csdn.net/bluewhalerobot/article/details/106770429">https://blog.csdn.net/bluewhalerobot/article/details/106770429</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2020/07/24/Mongodb%E6%80%A7%E8%83%BD%E5%8E%8B%E6%B5%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/07/24/Mongodb%E6%80%A7%E8%83%BD%E5%8E%8B%E6%B5%8B/" class="post-title-link" itemprop="url">Mongodb性能压测</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-07-24 11:36:34" itemprop="dateCreated datePublished" datetime="2020-07-24T11:36:34+00:00">2020-07-24</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Mongo/" itemprop="url" rel="index"><span itemprop="name">Mongo</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2020/07/24/Mongodb%E6%80%A7%E8%83%BD%E5%8E%8B%E6%B5%8B/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/07/24/Mongodb%E6%80%A7%E8%83%BD%E5%8E%8B%E6%B5%8B/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>5.1k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>5 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h2 id="一、背景"><a href="#一、背景" class="headerlink" title="一、背景"></a>一、背景</h2><p>这几天对所有的基础组件做一个摸底的基准压力测试，目前我们所有的开源基础组件都没有做过性能测试，经常有开发人员问，我们的RDS、MongoDB集群能抗多大量呀，这个时候我是没办法回复的，因为我自己也不知道，虽然一个数据库集群能抗多大量，在软件、硬件配置固定的情况下，和业务场景有很大的关系，如果数据量小，查询SQL简单那吞吐量自然很高，如果数据量特别大并且都是复杂SQL，那吞吐量自然上不去；但是既然人家问了，肯定是希望有一个答案，如果你说不知道，那会给人一种不靠谱的感觉，所以做一次基准压力测试，我们知道在特定的场景下我们的集群能有多大的吞吐量，做到自己心里有数，才给别人信心。这周在压测MongoDB，谷歌了一番，MongoDB的压测工具很少，有几篇是介绍通过YCSB压测MongoDB的，找（逻辑思维首席DBA）推荐一款MongoDB的压测工具，也推荐YCSB，好吧，那就它吧，开整。</p>
<h2 id="二、环境说明"><a href="#二、环境说明" class="headerlink" title="二、环境说明"></a>二、环境说明</h2><pre><code class="bash">1、MongoDB集群配置（一个分片的shard集群）
Mongodb性能压测

2、MongoDB版本
4.0.4-62-g7e345a7
4、系统及内核版本


CentOS Linux release 7.5.1804 (Core)
3.10.0-862.14.4.el7.x86_64
3、YCSB版本
YCSB-0.16.0-RC1.

4、测试说明
Mongodb性能压测</code></pre>
<h2 id="三、安装"><a href="#三、安装" class="headerlink" title="三、安装"></a>三、安装</h2><p>1、jdk及maven安装参考官方<br><a target="_blank" rel="noopener" href="https://github.com/brianfrankcooper/YCSB/tree/master/mongodb">https://github.com/brianfrankcooper/YCSB/tree/master/mongodb</a></p>
<p>2、安装YCSB<br>wget <a target="_blank" rel="noopener" href="https://github.com/brianfrankcooper/YCSB/archive/0.16.0-RC1.tar.gz">https://github.com/brianfrankcooper/YCSB/archive/0.16.0-RC1.tar.gz</a><br>tar -zxvf YCSB-0.16.0-RC1.tar.gz<br>cd YCSB-0.16.0-RC1/<br>mvn clean package -Dmaven.test.skip=true<br>PS：<br>安装过程中maven下载依赖需要×××，如果有安装失败的包，需要在能×××的服务器上下载手动安装，比如mongodb-async-driver-2.0.1.jar就需要×××，下面是手动安装方法<br>A、手动下载jar包<br>wget <a target="_blank" rel="noopener" href="http://www.allanbank.com/repo/com/allanbank/mongodb-async-driver/2.0.1/mongodb-async-driver-2.0.1.jar">http://www.allanbank.com/repo/com/allanbank/mongodb-async-driver/2.0.1/mongodb-async-driver-2.0.1.jar</a><br>B、加压包，从pom.xml 文件里面查看groupId、artifactId、version<br>C、手动安装</p>
<pre><code class="bash">mvn install:install-file -Dfile=/tmp/mongodb-async-driver-2.0.1.jar  -DgroupId=com.allanbank -DartifactId=mongodb-async-driver -Dversion=2.0.1 -Dpackaging=jar
mvn -pl com.yahoo.ycsb:mongodb-binding -am clean package</code></pre>
<h2 id="四、压测"><a href="#四、压测" class="headerlink" title="四、压测"></a>四、压测</h2><p>1、编写压测文件</p>
<h1 id="YCSB-测试需要python2-7环境-可以使用conda-create-n-venv-python-2-7-创建-link"><a href="#YCSB-测试需要python2-7环境-可以使用conda-create-n-venv-python-2-7-创建-link" class="headerlink" title="YCSB  测试需要python2.7环境  可以使用conda create -n venv python=2.7 创建  link"></a>YCSB  测试需要python2.7环境  可以使用conda create -n venv python=2.7 创建  <a target="_blank" rel="noopener" href="https://blog.csdn.net/sirobot/article/details/107067577">link</a></h1><p>在workloads目录下有很多压测文件用到的文件，我们从其中一个copy一份，编辑添加我们自己定义的内容</p>
<pre><code class="bash">vim workloads/2000w

ongodb.url=mongodb://root:123456@172.21.244.101:27000
mongodb.writeConcern=normal
table=chj_2000w
recordcount=20000000
operationcount=50000000
readallfields=true
readproportion=0
updateproportion=0
scanproportion=0
insertproportion=1
requestdistribution=zipfian
workload=com.yahoo.ycsb.workloads.CoreWorkload</code></pre>
<pre><code class="bash">关于YCSB的压测文件的每个参数的解释如下：

fieldcount: 每条记录字段个数 (default: 10)
fieldlength: 每个字段长度 (default: 100)
readallfields: 是否读取所有字段true或者读取一个字段false (default: true)
readproportion: 读取作业比例 (default: 0.95)
updateproportion: 更新作业比例 (default: 0.05)
insertproportion: 插入作业比例 (default: 0)
scanproportion: 扫描作业比例 (default: 0)
readmodifywriteproportion: 读取一条记录修改它并写回的比例 (default: 0)
requestdistribution: 请求的分布规则 uniform, zipfian or latest (default: uniform)
maxscanlength: 扫描作业最大记录数 (default: 1000)
scanlengthdistribution: 在1和最大扫描记录数的之间的分布规则 (default: uniform)
insertorder: 记录被插入的规则ordered或者hashed (default: hashed)
operationcount: 执行的操作数.
maxexecutiontime: 执行操作的最长时间，当然如果没有超过这个时间以运行时间为主。
table: 测试表的名称 (default: usertable)
recordcount: 加载到数据库的纪录条数 (default: 0)</code></pre>
<p>2、造数据，也是测写入性能</p>
<pre><code class="bash">./bin/ycsb load mongodb -threads 100 -P workloads/2000w</code></pre>
<p>输出结果说明</p>
<pre><code class="bash">[OVERALL], RunTime(ms), 37182  #数据加载所用时间(毫秒)
[OVERALL], Throughput(ops/sec), 13447.367005540314  #加载操作的吞吐量(ops/sec)
[TOTAL_GCS_PS_Scavenge], Count, 37
[TOTAL_GC_TIME_PS_Scavenge], Time(ms), 146
[TOTAL_GC_TIME_%_PS_Scavenge], Time(%), 0.3926631165617772
[TOTAL_GCS_PS_MarkSweep], Count, 0
[TOTAL_GC_TIME_PS_MarkSweep], Time(ms), 0
[TOTAL_GC_TIME_%_PS_MarkSweep], Time(%), 0.0
[TOTAL_GCs], Count, 37
[TOTAL_GC_TIME], Time(ms), 146
[TOTAL_GC_TIME_%], Time(%), 0.3926631165617772
[CLEANUP], Operations, 64
[CLEANUP], AverageLatency(us), 422.09375
[CLEANUP], MinLatency(us), 0
[CLEANUP], MaxLatency(us), 26911
[CLEANUP], 95thPercentileLatency(us), 3
[CLEANUP], 99thPercentileLatency(us), 30
[INSERT], Operations, 500000  # 执行insert操作的总数
[INSERT], AverageLatency(us), 4658.931652  # 每次insert操作的平均延时(微秒)
[INSERT], MinLatency(us), 831 # 所有insert操作的最小延时(微秒)
[INSERT], MaxLatency(us), 1784831 # 所有insert操作的最大延时(微秒)
[INSERT], 95thPercentileLatency(us), 9711  # 95%的insert操作延时在9毫秒以内
[INSERT], 99thPercentileLatency(us), 17903 # 99%的insert操作延时在17毫秒以内
[INSERT], Return=OK, 500000</code></pre>
<p>3、压测<br>通过调整压测文件中read和update的比例，模拟只读和读写混合的操作</p>
<pre><code class="bash">./bin/ycsb run mongodb -threads 100 -P workloads/2000w

[OVERALL], RunTime(ms), 1735408
[OVERALL], Throughput(ops/sec), 2881.1668495247227
[TOTAL_GCS_PS_Scavenge], Count, 3975
[TOTAL_GC_TIME_PS_Scavenge], Time(ms), 6180
[TOTAL_GC_TIME_%_PS_Scavenge], Time(%), 0.3561122226012557
[TOTAL_GCS_PS_MarkSweep], Count, 0
[TOTAL_GC_TIME_PS_MarkSweep], Time(ms), 0
[TOTAL_GC_TIME_%_PS_MarkSweep], Time(%), 0.0
[TOTAL_GCs], Count, 3975
[TOTAL_GC_TIME], Time(ms), 6180
[TOTAL_GC_TIME_%], Time(%), 0.3561122226012557
[READ], Operations, 500346
[READ], AverageLatency(us), 2851.9638989819045
[READ], MinLatency(us), 696
[READ], MaxLatency(us), 646655
[READ], 95thPercentileLatency(us), 6991
[READ], 99thPercentileLatency(us), 23103
[READ], Return=OK, 500346
[CLEANUP], Operations, 10
[CLEANUP], AverageLatency(us), 3131.0
[CLEANUP], MinLatency(us), 1
[CLEANUP], MaxLatency(us), 31295
[CLEANUP], 95thPercentileLatency(us), 31295
[CLEANUP], 99thPercentileLatency(us), 31295
[UPDATE], Operations, 4499654
[UPDATE], AverageLatency(us), 3534.2083122391186
[UPDATE], MinLatency(us), 704
[UPDATE], MaxLatency(us), 1078271
[UPDATE], 95thPercentileLatency(us), 11647
[UPDATE], 99thPercentileLatency(us), 27343
[UPDATE], Return=OK, 4499654</code></pre>
<h2 id="五、指标观察"><a href="#五、指标观察" class="headerlink" title="五、指标观察"></a>五、指标观察</h2><p>1、服务器指标，主要观察CPU、内存、磁盘IO的利用率和延时，可以通过top、iostat工具查看实时情况<br>2、MongoDB可以通过mongostat 工具查看实时情况</p>
<p>mongostat的输出说明</p>
<p>inserts：每秒插入次数<br>query：每秒查询次数<br>update：每秒更新次数<br>delete：每秒删除次数<br>getmore：每秒执行getmore次数<br>command：每秒的命令数，比以上插入、查找、更新、删除的综合还多，还统计了别的命令<br>dirty：WiredTiger存储引擎中dirty 数据占缓存百分比<br>used:WiredTiger存储引擎中引擎使用缓存占百分比<br>flushs：每秒执行fsync将数据写入硬盘的次数。<br>vsize：虚拟内存使用量，单位MB<br>res：物理内存使用量，单位MB<br>qrw:客户端等待读的长度,队列中的长度<br>arw:客户端等待写的队列长度<br>netIn 和 netOut：网络流量，单位是字节 byte<br>conn：当前连接数<br>time：时间戳<br>六、测试结果<br><a target="_blank" rel="noopener" href="https://blog.51cto.com/navyaijm/2421973?source=drh">Mongodb性能压测</a><br><a target="_blank" rel="noopener" href="https://www.yht7.com/news/21478">YCSB  压测</a><br>#　<a target="_blank" rel="noopener" href="https://www.cnblogs.com/zhongyuanzhao000/p/12152843.html">使用 JMeter压测工具 对 MySQL、MongoDB、Neo4j 进行性能测试</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  


  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/2/"><i class="fa fa-angle-left" aria-label="Previous page"></i></a><a class="page-number" href="/">1</a><a class="page-number" href="/page/2/">2</a><span class="page-number current">3</span><a class="page-number" href="/page/4/">4</a><span class="space">&hellip;</span><a class="page-number" href="/page/7/">7</a><a class="extend next" rel="next" href="/page/4/"><i class="fa fa-angle-right" aria-label="Next page"></i></a>
  </nav>



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">Hory Skone</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">67</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">30</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">35</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/horysk" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;horysk" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:admin@horysk.com" title="E-Mail → mailto:admin@horysk.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="http://www.hory-ai.com/" title="HoryAI → http:&#x2F;&#x2F;www.hory-ai.com" rel="noopener" target="_blank"><i class="fab fa-google fa-fw"></i>HoryAI</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://blog.csdn.net/sirobot" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;sirobot" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>CSDN</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.zhihu.com/people/AI_HH" title="ZhiHu → https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;AI_HH" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>ZhiHu</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.kaggle.com/" title="Kaggle → https:&#x2F;&#x2F;www.kaggle.com&#x2F;" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>Kaggle</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://tianchi.aliyun.com/competition/gameList/activeList" title="TianChi → https:&#x2F;&#x2F;tianchi.aliyun.com&#x2F;competition&#x2F;gameList&#x2F;activeList" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>TianChi</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://works.yangerxiao.com/honeyed-words-generator" title="土情话 → https:&#x2F;&#x2F;works.yangerxiao.com&#x2F;honeyed-words-generator" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>土情话</a>
      </span>
  </div>



      </div>

      
      <script type="text/javascript" charset="utf-8" src="/js/tagcloud.js"></script>
      <script type="text/javascript" charset="utf-8" src="/js/tagcanvas.js"></script>
      <div class="widget-wrap">
          <h3 class="widget-title">Tag Cloud</h3>
          <div id="myCanvasContainer" class="widget tagcloud">
              <canvas width="250" height="250" id="resCanvas" style="width:100%">
                  <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/AI/" rel="tag">AI</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/BI/" rel="tag">BI</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Centos/" rel="tag">Centos</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/DNS/" rel="tag">DNS</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Dapp/" rel="tag">Dapp</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Docker/" rel="tag">Docker</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Hack/" rel="tag">Hack</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Hexo/" rel="tag">Hexo</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/HyperLedger-Fabric/" rel="tag">HyperLedger Fabric</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Hyperledger-Fabric/" rel="tag">Hyperledger Fabric</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Iftop/" rel="tag">Iftop</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Linux/" rel="tag">Linux</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ML/" rel="tag">ML</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/MTProxy/" rel="tag">MTProxy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Mongo/" rel="tag">Mongo</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Network/" rel="tag">Network</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Pyppeteer/" rel="tag">Pyppeteer</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Tools/" rel="tag">Tools</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/VPN/" rel="tag">VPN</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Vnc/" rel="tag">Vnc</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/baostock/" rel="tag">baostock</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/block-chain/" rel="tag">block chain</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/centos-xfce-vnc/" rel="tag">centos-xfce-vnc</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/" rel="tag">docker</a><span class="tag-list-count">11</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/fabric/" rel="tag">fabric</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/" rel="tag">hexo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/horysk/" rel="tag">horysk</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/k8s/" rel="tag">k8s</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/" rel="tag">linux</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mongo/" rel="tag">mongo</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pyppeteer/" rel="tag">pyppeteer</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/" rel="tag">python</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/quant/" rel="tag">quant</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/stock/" rel="tag">stock</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/tushare/" rel="tag">tushare</a><span class="tag-list-count">1</span></li></ul>
              </canvas>
          </div>
      </div>
      
    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        
  <div class="beian"><a href="http://www.beian.miit.gov.cn/" rel="noopener" target="_blank">null </a>
  </div>

<div class="copyright">
  
  &copy; 2015 – 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hory Skone</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="Symbols count total">275k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="Reading time total">4:10</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  
  <script color='255,255,255' opacity='0.6' zIndex='-1' count='99' src="/lib/canvas-nest/canvas-nest.min.js"></script>
  <script size="300" alpha="0.6" zIndex="-1" src="/lib/canvas-ribbon/canvas-ribbon.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>


  <script defer src="/lib/three/three.min.js"></script>
    <script defer src="/lib/three/three-waves.min.js"></script>
    <script defer src="/lib/three/canvas_lines.min.js"></script>
    <script defer src="/lib/three/canvas_sphere.min.js"></script>


  
  <script>
    (function(){
      var canonicalURL, curProtocol;
      //Get the <link> tag
      var x=document.getElementsByTagName("link");
		//Find the last canonical URL
		if(x.length > 0){
			for (i=0;i<x.length;i++){
				if(x[i].rel.toLowerCase() == 'canonical' && x[i].href){
					canonicalURL=x[i].href;
				}
			}
		}
    //Get protocol
	    if (!canonicalURL){
	    	curProtocol = window.location.protocol.split(':')[0];
	    }
	    else{
	    	curProtocol = canonicalURL.split(':')[0];
	    }
      //Get current URL if the canonical URL does not exist
	    if (!canonicalURL) canonicalURL = window.location.href;
	    //Assign script content. Replace current URL with the canonical URL
      !function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=canonicalURL,t=document.referrer;if(!e.test(r)){var n=(String(curProtocol).toLowerCase() === 'https')?"https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif":"//api.share.baidu.com/s.gif";t?(n+="?r="+encodeURIComponent(document.referrer),r&&(n+="&l="+r)):r&&(n+="?l="+r);var i=new Image;i.src=n}}(window);})();
  </script>




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('https://cdn.jsdelivr.net/npm/valine@1.3.9/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : '2ASH47v4VIRijd91HeEi3pws-gzGzoHsz',
      appKey     : 'ojRfR89cSV614pgJFT36lFFB',
      placeholder: "昵称填写qq可以显示qq头像和昵称哦~",
      avatar     : 'monsterid',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : '' || 'zh-cn',
      path       : location.pathname,
      recordIP   : true,
      serverURLs : '',
      requiredFields: ['nick','mail'] 
    });
  }, window.Valine);
});
</script>

  <!-- 页面点击特效 -->
  <script type="text/javascript" src="/js/jquery-3.3.1.min.js"></script>
  <script type="text/javascript" src="/js/click-word.js"></script>
  
  <script type="text/javascript"
  color="255,255,255" opacity='0.7' zIndex="-2" count="500" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
  
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"log":false,"model":{"jsonPath":"/live2dw/assets/z16.model.json"},"display":{"position":"right","width":300,"height":600},"mobile":{"show":true}});</script></body>
</html>
